Reputation: 60
I have some issues in Windows 8.1 store apps, i want app event if wifi signal strength change, your answers will be appreciated
Upvotes: 1
Views: 493
Reputation: 2015
absolutely you can get signal bars but question is how to update network strength
i have answer for (i can provide exactly what should you if you provide xaml and c# code).. now all you have to do use "DispatcherTimer" which will update your signal strength time to time. use this code in your page initialization or app.xaml.cs initialization
using System.Windows.Threading;
DispatcherTimer timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
timer.Tick += delegate (object sender, EventArgs e)
{
// use your wifi class etc. e.g this.SignalStrengthProgressBar.Value = (FMRadio.Instance.SignalStrength); this is example for fm radio in wp8.
};
timer.Start();
here timespan.fromsecond(1) 1 is second adjust second according to your need because time update will suck your battery
like my answer ? upvote and mark as answer
Upvotes: 0
Reputation: 10346
Currently I cannot see any events for you to detect Wifi Signal Strength Changes. What I can think is to repeat reading the data in your app use dispatcher timer. More detail about building a Wi-Fi Scanner in the UWP you could refer to this document.
Upvotes: 0
Reputation: 757
You can make use of NetworkConnection class present inside the Windows.Networking.Connectivity namespace and use the ConnectionProfile class which has method called GetSignalBars which gives nullable byte from value 0 to 5.
var strength = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile().GetSignalBars();
More details about signal strength can be found here. Hope this helps.
Upvotes: 1