code: public int getNetworkType() {
  
          NetworkInfo activeNetworkInfo = getNetworkInfo();
  
          if (activeNetworkInfo != null) {
              // WIFI
              if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
                  return NETWORK_CLASS_WIFI;
              }
              // MOBILE
              else if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
                  return getMobileNetworkClass(activeNetworkInfo.getSubtype());
              }
          }
  
          return NETWORK_CLASS_UNKNOWN;
      }
docs: 2G/3G/4G/WIFI
  
  @return