When I request the Cell ID and LAC information, on some devices I cannot retreive them.
I use this code:
TelephonyManager tm =(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
location = (GsmCellLocation) tm.getCellLocation();
cellID = location.getCid();
lac = location.getLac();
So you can try something like. I have got cell id and the location area code for GSM. But for UMTS, getCid () returns a big number for exple 33 166 248. So i add modulo operator (exple xXx.getCid() % 0xffff).
GsmCellLocation cellLocation = (GsmCellLocation)telm.getCellLocation();
new_cid = cellLocation.getCid() % 0xffff;
new_lac = cellLocation.getLac() % 0xffff;