Android – Access Cell Phone details (Cell-Id, LAC, Signal Strength)

Show me the code! - By Davanum Srinivas

Here is the screen shot


Next Step(s)!

Need to figure out how to use cell-id/lac information to get a lat/long for the phone location! Please drop me a note or add comments here if you have an idea on how to do it. Thanks.


 package org.apache; import; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.telephony.PhoneStateIntentReceiver; import android.telephony.ServiceState; import android.util.Log; import android.widget.EditText; public class LocateMe extends Activity { private PhoneStateIntentReceiver mPhoneStateReceiver; private EditText mEditLac; private EditText mEditCid; private EditText mEditSignal; private static final int MY_NOTIFICATION_ID = 0x100; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); mPhoneStateReceiver = new PhoneStateIntentReceiver(this, new ServiceStateHandler()); mPhoneStateReceiver.notifyServiceState(MY_NOTIFICATION_ID); mPhoneStateReceiver.notifyPhoneCallState(MY_NOTIFICATION_ID); mPhoneStateReceiver.notifySignalStrength(MY_NOTIFICATION_ID); mPhoneStateReceiver.registerIntent(); mEditLac = (EditText) findViewById(; mEditCid = (EditText) findViewById(; mEditSignal = (EditText) findViewById(; } private class ServiceStateHandler extends Handler { public void handleMessage(Message msg) { Log.i("LocateMe", "In handleMessage : " + msg.what); switch (msg.what) { case MY_NOTIFICATION_ID: ServiceState state = mPhoneStateReceiver.getServiceState(); int cid = state.getCid()…

Ver la entrada original 39 palabras más



Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de

Estás comentando usando tu cuenta de Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

A %d blogueros les gusta esto: