is Wifi Enabled - Android android.net.wifi

Android examples for android.net.wifi:Wifi Enable

Description

is Wifi Enabled

Demo Code

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;

public class Main{

    public static boolean isWifiEnabled(Context context) {
        WifiManager mWifiManager = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        return mWifiManager.isWifiEnabled();
    }/*from  ww  w  . j ava2s  .c o m*/
}

Related Tutorials