Android Wifi State Check isWifiEnabled(Context context)

Here you can find the source of isWifiEnabled(Context context)

Description

is Wifi Enabled

Declaration

public static boolean isWifiEnabled(Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;

import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import android.telephony.TelephonyManager;

public class Main {

    public static boolean isWifiEnabled(Context context) {
        ConnectivityManager mgrConn = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        TelephonyManager mgrTel = (TelephonyManager) context
                .getSystemService(Context.TELEPHONY_SERVICE);
        return ((mgrConn.getActiveNetworkInfo() != null && mgrConn
                .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel
                .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS);
    }/*from w ww  .ja  v  a  2  s. c o  m*/
}

Related

  1. isWifiEnabledOrEnabling(WifiManager wifi)
  2. isWifiEnabledOrEnabling(WifiManager wifi)
  3. isWIFIAvailable(Context context)
  4. isWifiOnline(Context context)
  5. isWifi(Context context)
  6. isWifiConnected(Context context)
  7. isWifiConnected(Context context)
  8. checkWiFi(Context inContext)
  9. isOnWifi(Context context)