gpt4 book ai didi

android - TelephonyManager.getNetworkCountryIso() 究竟返回什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:25:25 26 4
gpt4 key购买 nike

如果数据连接不可用(因此 Geocoder 不起作用),我想找出用户当前所在的国家/地区。我想我可以通过使用 TelephonyManager.getNetworkCountryIso 在手机(不是平板电脑)上执行此操作,但我发现文档对我来说不够清楚。 documentation说:

Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).

Availability: Only when user is registered to a network. Result may be unreliable on CDMA networks (use getPhoneType() to determine if on a CDMA network).

这里的current registered operator具体是什么意思?这是否仅仅意味着用户当前连接到的网络,无论他们身在何处,而与他们的 SIM 注册位置(“家庭”网络)无关?

结果在什么意义上在 CDMA 网络上不可靠?这是否意味着它可能返回 null,或者给出非 null 但具有误导性或不准确的结果?

最佳答案

我相信 MCC 取决于您在世界上的位置。世界上很多地方都不使用 CDMA,导致您的手机在某些情况下无法连接。我相信在这些情况下它只会返回不准确的结果。

关于android - TelephonyManager.getNetworkCountryIso() 究竟返回什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26789128/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com