does anyone know how to get the signal strength without having to call the onSignalStrengthChanged. The problem with onSignalStrengthchanged is that is it called when the s
Based on Andre's answer above, in Kotlin you can use this one-liner (again API 17+):
fun getRadioSignalLevel(): Int {
return when (val info = telephonyManager.allCellInfo?.firstOrNull()) {
is CellInfoLte -> info.cellSignalStrength.level
is CellInfoGsm -> info.cellSignalStrength.level
is CellInfoCdma -> info.cellSignalStrength.level
is CellInfoWcdma -> info.cellSignalStrength.level
else -> 0
}
}