Android Wifi State Check isWifi(Context mContext)

Here you can find the source of isWifi(Context mContext)

Description

is Wifi

Declaration

public static boolean isWifi(Context mContext) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static boolean isWifi(Context mContext) {
        ConnectivityManager connectivityManager = (ConnectivityManager) mContext
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetInfo = connectivityManager
                .getActiveNetworkInfo();
        if (activeNetInfo != null
                && activeNetInfo.getTypeName().equals("WIFI")) {
            return true;
        }/*ww w. ja  v  a 2s. co  m*/
        return false;
    }
}

Related

  1. isWifiConnected(Context context)
  2. isWifiConnected(Context context)
  3. checkWiFi(Context inContext)
  4. isOnWifi(Context context)
  5. wifiEnable(Context context)
  6. getWifiManager(Context context)