Android Network State Check isNetworkEnabled(Context context)

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

Description

is Network Enabled

Declaration

public static boolean isNetworkEnabled(Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;

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

public class Main {
    public static boolean isNetworkEnabled(Context context) {
        ConnectivityManager conn = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = conn.getActiveNetworkInfo();
        return (info != null && info.isConnected());
    }//from w  ww . j  ava  2 s  .c om
}

Related

  1. isNetworkAvailable(Context context)
  2. isNetworkConnected(Context context)
  3. onNetwork(Context context)
  4. haveNetworkConnection(Context context)
  5. isNetworkConnected(Context context)
  6. check3GNetwork(Context context)
  7. IsNetworkConnected(Context context)
  8. isNetworkAvailableExt(Context paramContext)
  9. isNetworkAvailable(Context context)