code: @TargetApi(24)
      public String getMobileNetworkType() {
          String resultUnknown = "unknown";
  
          if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
              return resultUnknown;
          }
  
          if (getTelephonyManager() == null) {
              return resultUnknown;
          }
          switch (getTelephonyManager().getDataNetworkType()) {
              case TelephonyManager.NETWORK_TYPE_LTE:
                  return "4G";
              case TelephonyManager.NETWORK_TYPE_UMTS:
              case TelephonyManager.NETWORK_TYPE_EVDO_0:
              case TelephonyManager.NETWORK_TYPE_EVDO_A:
              case TelephonyManager.NETWORK_TYPE_HSDPA:
              case TelephonyManager.NETWORK_TYPE_HSUPA:
              case TelephonyManager.NETWORK_TYPE_HSPA:
              case TelephonyManager.NETWORK_TYPE_EVDO_B:
              case TelephonyManager.NETWORK_TYPE_EHRPD:
              case TelephonyManager.NETWORK_TYPE_HSPAP:
                  return "3G";
              case TelephonyManager.NETWORK_TYPE_GPRS:
              case TelephonyManager.NETWORK_TYPE_EDGE:
              case TelephonyManager.NETWORK_TYPE_CDMA:
              case TelephonyManager.NETWORK_TYPE_1xRTT:
              case TelephonyManager.NETWORK_TYPE_IDEN:
                  return "2G";
              default:
                  return resultUnknown;
          }
      }
docs: Get the type of mobile data network connection.
  It is recommended to call {@link #getCurrentConnectionType()} before this method to make sure
  that the device does have a mobile data connection.
  
  <p><b>Note:</b> This method is only available for Android API 24 and up. When used on a lower API version,
  this method will return "unknown".</p>
  
  @return "4G", "3G", "2G", or "unknown"