sketchub icon

Wifi Exemple to Enable and Disable (java)

CoCoCo_CoCoCo
13 Likes
6 Comments
211 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);

©2025 Sketchub | User Policy