Though GPS functionality has become hugely popular, it doesn't work indoors and not all devices have built-in GPS receivers. How do you get around this? Learn how to find and use CellID to locate your Android device and use Google maps to display it.
by Wei-Meng Lee
January 14, 2009
n earlier article about Android showed you how to interface with GPS receivers to obtain the geographical position of a device. However, not all today's mobile devices have built-in GPS receivers. Moreover, GPS does not work indoors. This seriously limits the usefulness of applications built around GPS technologies. One good way to expand the utility of your LBS services is to use your device's cell ID. This article will show you how to obtain the cell ID of an Android device and then use the Google Maps API to translate this cell ID value into latitude and longitude.
Author's Note: Click here for a discussion on using Cell ID for location-based services using a Windows Mobile device.
Creating the Project
Using Eclipse, create a new Android project and name it CellID. In main.xml, add a <Button> and <TextView> view:
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!