Android Network State Check isNetworkConnected(Context context)

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

Description

is Network Connected

Declaration

public static boolean isNetworkConnected(Context context) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static boolean isNetworkConnected(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        return (cm.getActiveNetworkInfo() != null)
                && cm.getActiveNetworkInfo().isConnectedOrConnecting();
    }/*from  w  w w  . ja va  2 s. c om*/
}

Related

  1. isConnectedMobile(Context context)
  2. isConnectingToInternet()
  3. isConnectingToInternet(Context context)
  4. isConnectionFast(int type, int subType)
  5. isNetworkAvailable()
  6. isOnline(Context c)
  7. isOnline(Context context)
  8. isNetworkReady(Context context)
  9. isConMeNetwork(String ssid)