1

Is there any way to check on Android device if installed SIM supports 4G or not?

Using TelephonyManager, we can find out status of current connected network. How can we know in advance if the SIM supports 4G?

Kemal Atik
  • 307
  • 3
  • 12
Darpan
  • 183
  • 2
  • 12
  • 3
    refer http://stackoverflow.com/questions/9283765/how-to-determine-if-network-type-is-2g-3g-or-4g – sasikumar Jan 05 '16 at 07:29
  • @sasikumar I've read those answers. That all detail about current connected network. My question is, irrespective of current network, is there a way to check if the SIM supports 4G network or not? – Darpan Jan 05 '16 at 08:18

1 Answers1

0

Use TelephonyManager to get it. like,

public String getNetworkClass(Context context) {
    TelephonyManager mTelephonyManager = (TelephonyManager)
            context.getSystemService(Context.TELEPHONY_SERVICE);
    int networkType = mTelephonyManager.getNetworkType();
    switch (networkType) {
        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";
        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_LTE:
            return "4G";
        default:
            return "Unknown";
    }
}

Hope it helps.

Let'sRefactor
  • 3,303
  • 4
  • 27
  • 43
  • 1
    As I've already mentioned, "Using TelephonyManager, we can find out status of current connected network." The question is, How can we know in advance if the SIM supports 4G? Even if it's not connected to network. – Darpan Mar 15 '16 at 11:58