I would like to know Location Area Code and Cell ID saved in sim card.
How to get Location Area Code and Cell ID in android phone.
best regards.
final TelephonyManager telephony = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (telephony.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
final GsmCellLocation location = (GsmCellLocation) telephony.getCellLocation();
if (location != null) {
msg.setText("LAC: " + location.getLac() + " CID: " + location.getCid());
}
}
Don't forget to set ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION or you'll get SecurityExceptions.
For example add the following to your