user289463
user289463

Reputation: 2814

Detecting a 4G capable device

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

How can I do that?

Thanks for any hints.

Upvotes: 4

Views: 939

Answers (2)

Alther
Alther

Reputation: 471

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.

Upvotes: 1

CommonsWare
CommonsWare

Reputation: 1007584

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.

Upvotes: 1

Related Questions