I have an app that needs to be connected to a specific network. I already have a code to force the device to connect to that network, but every time I open a different screen it repeats the process and it takes like 2 or 3 seconds. So, instead of forcing to connect every time I want to ask in what network it is in that moment, so, if it's the incorrect network it has to connect to the correct one, and if it's in the correct one it doesn't have to do anything. How can I get the network's name?
Below is the code I am using, but when I debug it it says the SSID name is "", so every time I check if the name is correct it says that is false and it connects again to the network.
public static string GetSSID() {
WifiManager wifiManager = (WifiManager)(Android.App.Application.Context.GetSystemService(Context.WifiService));
if (wifiManager != null && !string.IsNullOrEmpty(wifiManager.ConnectionInfo.SSID))
{
return wifiManager.ConnectionInfo.SSID;
}
else
{
return "WiFiManager is NULL";
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)