I am using Verizon's new LTE handset from HTC Thunderbolt. I cannot find the API to query for the signal strength while the handset is on LTE. By entering the field test mode (##4636##), I can see signal strength as -98dBm 2 asu. Anyone know what API I could use to get this info?
Dial *3001#12345#* and press the Call button. This will launch the Field Test Mode app and where the bars/dots were in the top left corner of the screen, you'll now see a negative number. The negative number is the decibel signal strength reading and should be followed by the carrier name and then the network type.
Excellent signal strength for 4G is around -90 dBm.
Warning : this solution should work for Android below API17. Some people may have troubles with newer api or specific phone brand (like Huawei)
You need to use this code. In fact, all the information you need is here :
String ssignal = signalStrength.toString();
String[] parts = ssignal.split(" ");
The parts[]
array will then contain these elements:
part[0] = "Signalstrength:" _ignore this, it's just the title_
parts[1] = GsmSignalStrength
parts[2] = GsmBitErrorRate
parts[3] = CdmaDbm
parts[4] = CdmaEcio
parts[5] = EvdoDbm
parts[6] = EvdoEcio
parts[7] = EvdoSnr
parts[8] = LteSignalStrength
parts[9] = LteRsrp
parts[10] = LteRsrq
parts[11] = LteRssnr
parts[12] = LteCqi
parts[13] = gsm|lte|cdma
parts[14] = _not really sure what this number is_
So, LTEdBm is :
TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
int dbm = 0;
if ( tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_LTE){
// For Lte SignalStrength: dbm = ASU - 140.
dbm = Integer.parseInt(parts[8])-140;
}
else{
// For GSM Signal Strength: dbm = (2*ASU)-113.
if (signalStrength.getGsmSignalStrength() != 99) {
int intdbm = -113 + 2
* signalStrength.getGsmSignalStrength();
dbm = Integer.toString(intdbm);
}
}
bye
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With