Back to project page androidtool.
The source code is released under:
MIT License
If you think the Android project androidtool listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.chris.android.tool.service; /* ww w. j ava 2s.c o m*/ import android.content.Context; import android.net.wifi.WifiManager; public class WifiService { private final WifiManager wifiManager; public WifiService(Context context) { this.wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); } public boolean isWifiEnabled() { return wifiManager.isWifiEnabled(); } public void setWifiEnabled(boolean isChecked) { wifiManager.setWifiEnabled(isChecked); } public WifiState getWifiState() { return WifiState.forId(wifiManager.getWifiState()); } public String getSSID() { return wifiManager.getConnectionInfo().getSSID(); } }