Android 查看SIM卡状态及SIM信息

来源:互联网 发布:mac virtualbox 全屏 编辑:程序博客网 时间:2024/05/18 22:55

Android查看SIM的状态

public void judgeSimState() {    TelephonyManager manager = (TelephonyManager) getApplicationContext().            getSystemService(Context.TELEPHONY_SERVICE);    int simState = manager.getSimState();    switch (simState){        case TelephonyManager.SIM_STATE_UNKNOWN: //0            //未知状态            break;        case TelephonyManager.SIM_STATE_ABSENT:  //1            //没有SIM卡            break;        case TelephonyManager.SIM_STATE_PIN_REQUIRED:  //2            //需要PIN解锁            break;        case TelephonyManager.SIM_STATE_PUK_REQUIRED:  //3            //需要PUK解锁            break;        case TelephonyManager.SIM_STATE_NETWORK_LOCKED:  //4            //需要NetworkPIN解锁            break;        case TelephonyManager.SIM_STATE_READY:            //良好            break;    }}
getSimSerialNumber():获取SIM卡号

getSimOperator():获取供货商代码

getSimOperatorName():获取供货商

getSimCountryIso():获取国籍

getNetworkOperator():获取网络运营商

getNetworkOperatorName():获取网络运营商名称

getNetworkType():获取网络类型

1 0
原创粉丝点击