Android Network State Check isOpenNetwork(Context context)

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

Description

is Open Network

Declaration

public static boolean isOpenNetwork(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;

import android.net.ConnectivityManager;

public class Main {

    public static boolean isOpenNetwork(Context context) {
        ConnectivityManager connManager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        if (connManager.getActiveNetworkInfo() != null) {
            return connManager.getActiveNetworkInfo().isAvailable();
        }/*  ww  w .  ja  v  a  2  s . c o m*/

        return false;
    }
}

Related

  1. IsNetworkConnected(Context context)
  2. isNetworkAvailableExt(Context paramContext)
  3. isNetworkAvailable(Context context)
  4. getNetworkState(Context context)
  5. isLocationEnabledNetwork(Context c)
  6. loadImageFromNetwork(String photoUrl)
  7. IsInternetReachable()
  8. setMobileDataEnabled(Activity a, Context context, boolean enabled)
  9. isNetworkAvailable(Activity mainActivity)