Can I disable a wireless network using the Android SDK or NDK?

Can I disable the wireless network on an Android device using the Android SDK or NDK?

+3
source share
2 answers

To enable / disable WiFi status, you must provide the following permission in the application manifest

android.permission.CHANGE_WIFI_STATE

Then you can use WifiManager to set WIFI enable / disable.

WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(enabled);

Additional information about http://developer.android.com/reference/android/net/wifi/WifiManager.html

For a full selection, check the following message: http://android-er.blogspot.com/2011/01/turn-wifi-onoff-using.html

+4
source

Yes, you can disable Wi-Fi programmatically:

. , AndroidManifest.xml

+1

All Articles