我需要检测GSM/UMTS无线调制解调器当前所在国家的MCC。
发布于 2010-12-03 22:16:09
基于GSM网络的
您需要在TelephonyManager中使用getSimCountryIso()和getNetworkCountryIso()
返回与SIM卡提供商的国家代码等效的国际标准化组织国家代码。
的Geocoder类
发布于 2015-11-18 05:45:08
首先获取MCC/MNC:
TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String networkOperator = tel.getNetworkOperator();
if (networkOperator != null) {
int mcc = Integer.parseInt(networkOperator.substring(0, 3));
int mnc = Integer.parseInt(networkOperator.substring(3));
}然后,在此基础上,您可以获得所选MCC对应的号码。互联网上有很多列表,例如this one on Wikipedia
https://stackoverflow.com/questions/4345973
复制相似问题