Android Context Check isConnected(Context connext)

Here you can find the source of isConnected(Context connext)

Description

is Connected

Declaration

public static boolean isConnected(Context connext) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Main {
    public static boolean isConnected(Context connext) {
        ConnectivityManager connectivityManager = (ConnectivityManager) connext
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = connectivityManager.getActiveNetworkInfo();
        if (info != null && info.isConnected()) {
            return true;
        }/*  ww w. ja v a 2 s  . c o  m*/
        return false;
    }
}

Related

  1. isAppInstalled(Context context, String uri)
  2. isAppOnForeground(Context context)
  3. isApplicationBroughtToBackground( final Context context)
  4. isApplicationBroughtToBackground( final Context context)
  5. isCallable(Context context, String url)
  6. isConnected(Context context)
  7. isDebugCertificateCheck(final Context context)
  8. isDebuggable(final Context context, final boolean includeDefaultDebugCertificateCheck)
  9. isExisting(Context context, Uri uri, String selection, String[] args)