4

I need to detect the 4G capability of the device.

How can I do that?

Thanks for any hints.

manlio
  • 18,345
  • 14
  • 76
  • 126
user289463
  • 2,804
  • 3
  • 20
  • 21

2 Answers2

1

I have the same need. What you really want is the current bandwidth. You get that info from WiFi, but not mobile. So the next best thing I came up with was to detect if the device is on 4G or not. Unfortunately, it's not so simple.

Besides WiMAX, you can check if the device has a mobile connection using the ConnectivityManager. If you detect a type of ConnectivityManager.TYPE_MOBILE, you then check the subtype. If the subtype is TelephonyManager.NETWORK_TYPE_LTE or TelephonyManager.NETWORK_TYPE_EHRPD, the device is 4G capable.

If the active network is subtype TelephonyManager.NETWORK_TYPE_LTE, then you are on 4G (but I haven't had the opportunity to verify this). If you detect TelephonyManager.NETWORK_TYPE_EHRPD, you have no idea if you are on 3G or 4G...at least I haven't been able to detect the difference yet.

There may be other subtypes that indicate a 4G capable device, but I haven't empirically verified them.

It's certainly not a definitive answer, but I hope it helps.

Alther
  • 451
  • 4
  • 6
1

4G is not something you can "detect", because 4G is a marketing term, not a technical term.

You can detect if an established connection is WiMAX using ConnectivityManager. I am not aware of Android supporting any other types of connectivity that are marketed specifically as 4G.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491