Sdílet prostřednictvím


TelephonyManager.GetNetworkCountryIso(Int32) Method

Definition

Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available.

[Android.Runtime.Register("getNetworkCountryIso", "(I)Ljava/lang/String;", "GetGetNetworkCountryIso_IHandler", ApiSince=30)]
public virtual string GetNetworkCountryIso (int slotIndex);
[<Android.Runtime.Register("getNetworkCountryIso", "(I)Ljava/lang/String;", "GetGetNetworkCountryIso_IHandler", ApiSince=30)>]
abstract member GetNetworkCountryIso : int -> string
override this.GetNetworkCountryIso : int -> string

Parameters

slotIndex
Int32

the SIM slot index to get network country ISO.

Returns

the lowercase 2 character ISO-3166-1 alpha-2 country code, or empty string if not available.

Attributes

Remarks

Returns the ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) of the current registered operator or the cell nearby, if available. This is same as #getNetworkCountryIso() but allowing specifying the SIM slot index. This is used for accessing network country info from the SIM slot that does not have SIM inserted.

Note: Result may be unreliable on CDMA networks (use #getPhoneType() to determine if on a CDMA network).

Java documentation for android.telephony.TelephonyManager.getNetworkCountryIso(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to