List of utility methods to do Wifi State Check
boolean | getWifiState(Context context) get Wifi State ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); State wifistate = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI) .getState(); if (wifistate != State.CONNECTED) { return false; State mobileState = cm.getNetworkInfo( ... |
boolean | isConnectedWifi(Context context) Check if there is any connectivity to a Wifi network NetworkInfo info = Connectivity.getNetworkInfo(context);
return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_WIFI);
|
boolean | isConnectedWifi(Context context) is Connected Wifi NetworkInfo info = getNetworkInfo(context);
return isConnected(info)
&& info.getType() == ConnectivityManager.TYPE_WIFI;
|
boolean | isWifiAvailable(Context context) is Wifi Available ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiInfo = cm .getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifiInfo != null && wifiInfo.isConnected()) { return true; return false; ... |
boolean | isWifiDisabled(WifiManager wifi) is Wifi Disabled return wifi.getWifiState() == WifiManager.WIFI_STATE_DISABLED;
|
boolean | isWifiDisabled(WifiManager wifi) is Wifi Disabled return wifi.getWifiState() == WifiManager.WIFI_STATE_DISABLED;
|
boolean | isWifiEnabled(WifiManager wifi) is Wifi Enabled return wifi.getWifiState() == WifiManager.WIFI_STATE_ENABLED;
|
boolean | isWifiEnabled(WifiManager wifi) is Wifi Enabled return wifi.getWifiState() == WifiManager.WIFI_STATE_ENABLED;
|
boolean | isWifiEnabledOrEnabling(WifiManager wifi) is Wifi Enabled Or Enabling int wifiState = wifi.getWifiState(); return wifiState == WifiManager.WIFI_STATE_ENABLED || wifiState == WifiManager.WIFI_STATE_ENABLING; |
boolean | isWifiEnabledOrEnabling(WifiManager wifi) is Wifi Enabled Or Enabling int wifiState = wifi.getWifiState(); return wifiState == WifiManager.WIFI_STATE_ENABLED || wifiState == WifiManager.WIFI_STATE_ENABLING; |