有一个Android应用程序访问SIM卡? [英] Access the SIM Card with an Android Application?
问题描述
我不知道是否有可能有一个Android应用程序
I wonder if it's possible to access to the SIM card with an Android Application
推荐答案
您可以得到IMEI这样的(但它是你想要什么?),只是一个为例:
You can get the IMEI like this (but is it what you want ?), just an exemple :
mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();
同样,你有
String getSimCountryIso():
返回ISO国家code相当于SIM卡提供商的国家code。
Returns the ISO country code equivalent for the SIM provider's country code.
字符串getSimOperator():
返回SIM卡的提供商的MCC + MNC(移动国家code +移动网络code)
String getSimOperator():
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.
字符串getSimOperatorName():
返回服务提供者名称(SPN)
String getSimOperatorName():
Returns the Service Provider Name (SPN).
字符串getSimSerialNumber():
返回SIM卡的序列号,如果适用
String getSimSerialNumber():
Returns the serial number of the SIM, if applicable.
INT getSimState():
返回一个常量,指示装置SIM卡的状态
int getSimState():
Returns a constant indicating the state of the device SIM card.
字符串getSubscriberId():
返回唯一的用户ID,例如IMSI的GSM手机
String getSubscriberId():
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
有关更多,看看此页面
和别忘了添加正确的权限在清单( getDeviceId()=>所需权限:READ_PHONE_STATE
)
and don't forget to add the correct permission in the manifest (getDeviceId() => Requires Permission: READ_PHONE_STATE
)
这篇关于有一个Android应用程序访问SIM卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!