Android Network State 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.content.Context;
import android.net.ConnectivityManager;

public class Main {
    public static boolean isOnline(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);

        return ((cm.getActiveNetworkInfo() != null) && cm
                .getActiveNetworkInfo().isConnectedOrConnecting());
    }/*from w  ww. j av a 2s .c om*/
}

Related

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