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'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 true
for GSM (TelephonyManager.isNetworkRoaming()
)
TelephonyManager.isNetworkRoaming()
will return true
. If data roaming is disabled or 'use only 2g' is enabled NetworkInfo.isRoaming()
will return false
, because no data connection is established. If you switch data services on NetworkInfo.isRoaming()
will return true
as well, since now both (GSM and data connection) are established and in roaming mode –
Yahairayahata © 2022 - 2024 — McMap. All rights reserved.