Code example for NetworkInfo

Methods: getSubtype, getType, isConnected

0
   * @return 
   */ 
  public static boolean isConnectedFast(Context context){
    ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo info = cm.getActiveNetworkInfo();
    return (info != null && info.isConnected() && Connectivity.isConnectionFast(info.getType(),info.getSubtype()));
  } 
 
  /** 
   * Check if the connection is fast 
   * @param type 
   * @param subType 
   * @return 
   */ 
  public static boolean isConnectionFast(int type, int subType){
    if(type==ConnectivityManager.TYPE_WIFI){
      System.out.println("CONNECTED VIA WIFI");
      return true; 
    }else if(type==ConnectivityManager.TYPE_MOBILE){
      switch(subType){
        case TelephonyManager.NETWORK_TYPE_1xRTT: