Location-Based Services Using CellID in Android

Location-Based Services Using CellID in Android

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 and view:

Figure 1. How Your App Should Look: The UI of your LBS application.

This will create the layout you see Figure 1.

Because this application requires Internet connectivity along with access to cell location information, add the relevant permission to the AndroidManifest.xml file:


In the file, import the following packages:

import;import;import;import;import;import;import;import;import;import android.content.Intent;import;import android.os.Bundle;import android.telephony.gsm.GsmCellLocation;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;



Share the Post: