0

I want to get this information.For that I wrote following code but it is not works.

TelephonyManager telephonyManager = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
// for example value of first element
CellInfoGsm cellinfogsm = (CellInfoGsm)telephonyManager.getAllCellInfo().get(0);
CellSignalStrengthGsm cellSignalStrengthGsm = cellinfogsm.getCellSignalStrength();
int Mrssi = cellSignalStrengthGsm.getDbm();

And is it possible to get this value for API level below 17? Please help regarding this.

yogeshbhimani
  • 49
  • 1
  • 3
  • 7

1 Answers1

0

You need to create a PhoneStateListener and handle the onSignalStrengthChanged callback for this and override the method onSignalStrengthsChanged(SignalStrength signalStrength).

You can find more information here...

Get Signal Strength in Android

Community
  • 1
  • 1
Trevor
  • 7,777
  • 6
  • 31
  • 50
  • I want that whenever I click on button I will get current signal strength.I don't want that when the signal strength will be change it will show me. – yogeshbhimani Oct 14 '14 at 06:18
  • @yogeshbhimani good luck getting it then. You have to create a PhoneStateListener in order to get the value below 17... – Trevor Oct 14 '14 at 06:32