how to check WiFi connection is automatic or established manually in android?

社会主义新天地 提交于 2019-12-11 01:54:01

问题


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();
        ...
   }           
 }


来源:https://stackoverflow.com/questions/8924401/how-to-check-wifi-connection-is-automatic-or-established-manually-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!