Android Context Check isOnline(Context context)

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

Description

is Online

Declaration

public static boolean isOnline(Context context) 

Method Source Code

//package com.java2s;
import android.net.ConnectivityManager;

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

public class Main {
    public static boolean isOnline(Context context) {
        ConnectivityManager con_manager = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        return con_manager.getActiveNetworkInfo() != null
                && con_manager.getActiveNetworkInfo().isAvailable()
                && con_manager.getActiveNetworkInfo().isConnected();
    }/*from   ww w  .  j  ava2  s .  c  o m*/
}

Related

  1. isMobile(Context context)
  2. isMobilityInstalled(Context context)
  3. isNetAvailable(Context context)
  4. isOnline(Context c)
  5. isOnline(Context context)
  6. isOnline(Context context)
  7. isOnline(Context context)
  8. isPermissionGranted(Context ctx)
  9. isSensAppInstalled(Context context)