code: public static boolean isConnectedMobile(Context context) {
          ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
          NetworkInfo info = cm.getActiveNetworkInfo();
          return (info != null && info.isConnected() && info.getType() == ConnectivityManager.TYPE_MOBILE);
      }
docs: Check if there is any connectivity to a mobile network
  <p/>
  Can be used in combination with {@link #isConnectedWifi}
  to provide different features if the device is on a wifi network or a cell network.
  
  @param context The current Context or Activity that this method is called from
  @return true if a mobile connection is available, otherwise false.