728x90

    private void EnableWifi()
   
{
     
string networkSSID = "bbox-xxx";
     
string networkPass = "mypass";

     
WifiConfiguration wifiConfig = new WifiConfiguration();
      wifiConfig
.Ssid = string.Format("\"{0}\"", networkSSID);
      wifiConfig
.PreSharedKey = string.Format("\"{0}\"", networkPass);

     
WifiManager wifiManager = (WifiManager)Application.Context.GetSystemService(Context.WifiService);

     
// Use ID
     
int netId = wifiManager.AddNetwork(wifiConfig); wifiManager.Disconnect();
      wifiManager
.EnableNetwork(netId, true);
      wifiManager
.Reconnect();
   
}

 

 

참고

https://stackoverflow.com/questions/8818290/how-do-i-connect-to-a-specific-wi-fi-network-in-android-programmatically

https://gist.github.com/Cheesebaron/5844638

728x90

'C# > Xamarin Maui' 카테고리의 다른 글

(Xamarin Forms) 1.ContentPage  (0) 2017.06.29
(Xamarin Forms) StartTimer  (0) 2017.06.22
(Xamarin.Android) splash screen 넣기  (0) 2017.06.17
(Xamarin.Android) AdMob 광고 넣기 (2)  (3) 2017.06.15
(Xamarin.Android) AdMob 광고 넣기 (1)  (0) 2017.06.15
Posted by kjun.kr
,