sketchub icon

Wifi Exemple to Enable and Disable (java)

CoCoCo_CoCoCo
14 Likes
6 Comments
220 Downloads

Screenshots

About

The android.net.wifi.WifiManager class can be used to manager the wifi connectivity. It can be used to add network. disable network, scan for access points, disconnect etc.

CodeSource:

× Button1: Enable

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); // wifi.setWifiEnabled(true); -------------------------------------------------‐------- × Button2: Disable

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); // wifi.setWifiEnabled(false);

©2026 Sketchub | User Policy