Saturday, December 21, 2013

Android - Turn WiFi On and Off Programmatically


Programmatically turn WiFi On and Off on android platform using following permissions in Manifest file.

android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE

and following code

WifiManager wifi_manager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
wifi_manager.setWifiEnabled(false); //True or False


    

No comments:

Post a Comment