Difference between NetworkInfo.isRoaming() and TelephonyManager.isNetworkRoaming()

StackOverflow https://stackoverflow.com/questions/7244563

  •  16-01-2021
  •  | 
  •  

Вопрос

I'm trying to detect wether the device is roaming or not in my app and I've found these two methods:

Is there an essential difference between them or can I just choose one?

Это было полезно?

Решение

I think TelephonyManager.isNetworkRoaming()is 2G-related, whether NetworkInfo.isRoaming() is 3G-related - setting data-roaming on/off is a distinct option in the android-settings, so if it's off you still may get truefor GSM (TelephonyManager.isNetworkRoaming())

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top