how to check WiFi connection is automatic or estab

2019-07-17 00:31发布

问题:

I am doing a small android application, which will show established WiFi connection is automatic or Manuel. Is it possible to take WiFi access point which is set by user in default "setting" application?

Thanks, Vani

回答1:

see this

 [ www.developer.android.com/reference/android/net/wifi/package-summary.html] 

or

WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
 if (wifiManager != null) {
     WifiInfo info = wifiManager.getConnectionInfo();
     if (info != null) {
        String ssid = info.getSSID();
        ...
   }           
 }