Please see the following code
wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); if (wifi.isWifiEnabled() == false) { Toast.mak
To be able to access the wifi you need android:name="android.permission.ACCESS_WIFI_STATE" as you already know.
If you are enabling or disabling the wifi connection you are also going to need both permissions: ACCESS_WIFI_STATE and CHANGE_WIFI_STATE
That should do it for you.