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
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
That should do it for you.
It should be "uses-permission" rather than "user-permission". spelling is wrong
add following lines
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
hope they help!