Android Network State Check check3GNetwork(Context context)

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

Description

check G Network

Declaration

public static boolean check3GNetwork(Context context) 

Method Source Code

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

public class Main {
    public static boolean check3GNetwork(Context context) {
        ConnectivityManager connectivity = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        if (connectivity == null) {
            return false;
        } else {/*from   w  w  w  . ja  v a 2 s.  c  om*/
            NetworkInfo info = connectivity.getActiveNetworkInfo();
            if (info == null) {
                return false;
            } else {
                if (info.isAvailable()) {
                    return true;
                }

            }
        }
        return false;
    }
}

Related

  1. isNetworkConnected(Context context)
  2. onNetwork(Context context)
  3. haveNetworkConnection(Context context)
  4. isNetworkConnected(Context context)
  5. isNetworkEnabled(Context context)
  6. IsNetworkConnected(Context context)
  7. isNetworkAvailableExt(Context paramContext)
  8. isNetworkAvailable(Context context)
  9. getNetworkState(Context context)