Android Wifi State Check isOnWifi(Context context)

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

Description

is On Wifi

Declaration

public static boolean isOnWifi(Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;

import android.net.wifi.WifiManager;

public class Main {
    public static boolean isOnWifi(Context context) {
        WifiManager lWifiManager = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        return lWifiManager == null ? false : lWifiManager.isWifiEnabled()
                && lWifiManager.getConnectionInfo() != null
                && lWifiManager.getConnectionInfo().getIpAddress() != 0;
    }/*from   w w  w  .ja  v a  2s .  com*/
}

Related

  1. isWifi(Context context)
  2. isWifiEnabled(Context context)
  3. isWifiConnected(Context context)
  4. isWifiConnected(Context context)
  5. checkWiFi(Context inContext)
  6. wifiEnable(Context context)
  7. isWifi(Context mContext)
  8. getWifiManager(Context context)