How to Enable or Disable WiFi from Android Application Programatically ?

Posted on .
Android-Wifi-Hotspot

Hello guyz what’s going on? Today’s topic is also very easy in this section we will do some Wifi Coding , How to enable or disable WIfi through Android Application,Lets Code –

You can download source code for free and can apply it on your code , You have to keep on thing in your mind that you have to give Wifi permissions in Manifest.

<uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” />
<uses-permission android:name=”android.permission.INTERNET” />
<uses-permission android:name=”android.permission.CHANGE_WIFI_STATE” />

Download Code

Lets start with designing part which is very simple in my case , i have taken two button for enable or disable wifi through android application.

activity_main.xml

MainActivity.java

AndroidManifest.xml

Now Check it on your Android Device and enjoy 🙂 . Feel free to ask any question and keep reading 🙂