Back to project page droid-aegis.
The source code is released under:
MIT License
If you think the Android project droid-aegis 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 andi.cctv.app; //from w w w . ja va 2 s . c o m import android.net.wifi.WifiManager; import android.util.Log; public class WifiCheck { private static final String tag = "WifiCheck"; public boolean enableWifi (WifiManager connMgr) { boolean connected = false; boolean wifi = connMgr.isWifiEnabled(); if (wifi) { Log.d(tag, "WiFi is enabled. Do nothing"); } else { Log.d(tag, "Wifi is disabled. Enable Wifi"); if (connMgr.setWifiEnabled(true)) { Log.d(tag, "Wifi Enabled."); connected = true; } } return connected; } }