TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
CellInfo ci = tm.getAllCellInfo().get(0) ; // Registered Cell Tower
if (ci instanceof CellInfoGsm) {
((CellInfoGsm)ci).getCellIdentity().getArfcn();
} else if (ci instanceof CellInfoWcdma) {
((CellInfoWcdma)ci).getCellIdentity().getUarfcn();
} else if (ci instanceof CellInfoLte) {
((CellInfoLte)ci).getCellIdentity().getEarfcn();
}
Errors :
Solved;
setup sdkversion to 24 didn't make attention this was added in API 24.