Android WCDMA and HSDPA Detection

I have an application that runs on Android version 1.6+, and you need to determine the type of network.

I have a problem with HSDPA and WCDMA, however - the former has a specific constant for TelephonyManager # getNetworkType in API version 5+, and the latter does not seem to have it at all.

Does anyone know that a phone on these network types will return for TelephonyManager # getNetworkType before and after Android 2.0? (I assume that in 2.0+ on the HSDPA network, it will return the corresponding constant, but the rest will appear undefined ...)

+4
source share
1 answer

According to the source code for the TelephonyManager class in Android 1.6, the return value for HSPDA and WCDMA should be NETWORK_TYPE_UNKNOWN (0).

If you look at the constants defined in the Telephony Manager documentation for different types of networks, you can see when each type of network was introduced in the API:

HSPDA: API Version 5+
WCDMA: (Not Documented)

Based on what I read on wCDipedia on WCDMA , this is also called UMTS, which means the WCDMA phone will return NETWORK_TYPE_UMTS (3).

Summary

HSPDA:

  • returns NETWORK_TYPE_UNKNOWN (0) in API version 4 (Android <= 1.6)
  • returns NETWORK_TYPE_HSDPA (8) in API version 5+ (Android 2.0+)

WCDMA:

  • returns NETWORK_TYPE_UMTS (3) since API Version 1

EDIT

It should also be noted that since Android is open source, it is possible that the handset provider has redefined these values ​​and functions, so it is possible that they may deviate from the external line version.

+7
source

Source: https://habr.com/ru/post/1342114/


All Articles