android - How to get current cell signal strength? -
i store cell signal strength, , this:
private class getrssi extends phonestatelistener { @override public void onsignalstrengthschanged(signalstrength signalstrength) { super.onsignalstrengthschanged(signalstrength); variables.signal = signalstrength.getgsmsignalstrength(); } }
okay runs if changes. need current signal strength.
is there method ask current signal strength?
there getallcellinfo() method in telephonymanager added in api 17 solution. example of use:
telephonymanager telephonymanager = (telephonymanager)this.getsystemservice(context.telephony_service); // example value of first element cellinfogsm cellinfogsm = (cellinfogsm)telephonymanager.getallcellinfo().get(0); cellsignalstrengthgsm cellsignalstrengthgsm = cellinfogsm.getcellsignalstrength(); cellsignalstrengthgsm.getdbm();
Comments
Post a Comment