Hello,
i would like to know how to get the signal network strenght ?
Imagine this scenario, worker are in front of the door of one client and if signal is not good we need to not allow some operations.
thanks
Hello,
i would like to know how to get the signal network strenght ?
Imagine this scenario, worker are in front of the door of one client and if signal is not good we need to not allow some operations.
thanks
Hello,
Welcome to our Microsoft Q&A platform!
You can use TelephonyManager to monitor GSM signal strength like following code.
TelephonyManager telephonyManager = (TelephonyManager)this.GetSystemService(Context.TelephonyService);
telephonyManager.Listen(new MyPhoneStateListener(textView1), PhoneStateListenerFlags.SignalStrengths) ;
internal class MyPhoneStateListener : PhoneStateListener
{
private TextView textView1;
public MyPhoneStateListener(TextView textView1)
{
this.textView1 = textView1;
}
public override void OnSignalStrengthsChanged(SignalStrength signalStrength)
{
base.OnSignalStrengthsChanged(signalStrength);
int asu = signalStrength.GsmSignalStrength;
textView1.Text = asu + "";
}
}
```
And do not forget to add following permission and grant it at runtime.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
I make a test in emulator. Signal None is 0, Poor is 5, Moderate is 12, good is 20, Greate is 30

Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
5 people are following this question.