Hi,

I use the below code to get cell id,but for 3g sim card it provides wrong 
cell id.
int getCellId() {
try {
 final TelephonyManager telephony = (TelephonyManager) 
getSystemService(Context.TELEPHONY_SERVICE);
if (telephony.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
final GsmCellLocation location = (GsmCellLocation) telephony
.getCellLocation();
if (location != null) {
int cellId = location.getCid();
  cellId = cellId % 0xffff;
Log.d(tag,"Cell ID ="+cellId);
 // body.setText(cellId+"");
return cellId; 
}
 } else {
 }
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to