Here you can find the source of check3GNetwork(Context context)
public static boolean check3GNetwork(Context context)
//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; } }