code: public static boolean checkMobileDataState() throws Exception {
          try {
              ConnectivityManager connectivityManager = (ConnectivityManager) QuickUtils.getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
              Class connectivityManagerClass = Class.forName(connectivityManager.getClass().getName());
              Method getMobileDataEnabled = connectivityManagerClass.getDeclaredMethod("getMobileDataEnabled");
              getMobileDataEnabled.setAccessible(true);
  
              return (Boolean) getMobileDataEnabled.invoke(connectivityManager);
          } catch(Exception e) {
              e.printStackTrace();
              throw new Exception("Unexpected exception. Please check stack trace");
          }
      }
docs: Check state of mobile data connectivity (on/off).
  Please note that this method *does not* guarantee that a connection is available, it only
  checks if mobile data is turned on/off.
  @return true if enabled, false if disabled