Turn on /off WiFi sketchware



Hello Amigos, i hope you are doing well
Sorry for the late,

Like, share and subscribe for more videos 



Code used :

final android.net.wifi.WifiManager wifi = (android.net.wifi.WifiManager)getSystemService(Context.WIFI_SERVICE); if (wifi.isWifiEnabled()) { wifi.setWifiEnabled(false); showMessage("Wifi Disable"); } else { wifi.setWifiEnabled(true); showMessage("Wifi Enable"); }


// add permission

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

Comments

Post a Comment

Popular posts from this blog

Read Json file from asset in Sketchware Pro

Change wallpaper Programmatically Sketchware

Web Scraping With Jsoup in Sketchware