Signal-intensity monitoring is a very common feature of Android phones. Today, this article shows an example of how Android realizes signal intensity monitoring. Share to everyone for your reference.
The specific implementation code is as follows:
Telephonymanager Tel;
Myphonestatelistener MyListener;
/* Update the Listener, and start it *
/MyListener = new Myphonestatelistener ();
Tel = (Telephonymanager) getsystemservice (context.telephony_service);
Tel.listen (MyListener, phonestatelistener.listen_signal_strengths);
Private class Myphonestatelistener extends Phonestatelistener {
* * from the resulting signal strength, each tiome supplier has an update/public
void Onsignalstrengthschanged (Signalstrength signalstrength) {
super.onsignalstrengthschanged (SignalStrength);
Toast.maketext (Getapplicationcontext (), "Go to firstdroid!!! GSM Cinr = "+ string.valueof (Signalstrength.getgsmsignalstrength ()), Toast.length_short). Show ();
Interested friends can test the sample code in this article, I hope that the Android program for everyone to play a certain role in helping.