Search code examples
androidwifistatus

Checking Wi-Fi enabled or not on Android


What would the code be for checking whether the Wi-Fi is enabled or not?


Solution

  • WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    if (wifiManager.isWifiEnabled()) {
      // wifi is enabled
    }
    

    For details check here