is Wifi Enabled via WifiManager - Android android.net.wifi

Android examples for android.net.wifi:Wifi Enable

Description

is Wifi Enabled via WifiManager

Demo Code

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import java.util.List;

public class Main{

    public static boolean isWifiEnabled(Context c) {
        WifiManager wifiManager = getWifiManger(c);
        return wifiManager.isWifiEnabled();
    }//  w  w w  .jav  a2 s.c o m
    private static WifiManager getWifiManger(Context c) {
        return (WifiManager) c.getSystemService(c.WIFI_SERVICE);
    }

}

Related Tutorials