public String readSIMCard() { TelephonyManager tm = (TelephonyManager)this.getSystemService(TELEPHONY_SERVICE);//取得相关系统服务 StringBuffer sb = new StringBuffer(); switch(tm.getSimState()){ //getSimState()取得sim的状态 有下面6中状态 case TelephonyManager.SIM_STATE_ABSENT :sb.append("无卡");break; case TelephonyManager.SIM_STATE_UNKNOWN :sb.append("未知状态");break; case TelephonyManager.SIM_STATE_NETWORK_LOCKED :sb.append("需要NetworkPIN解锁");break; case TelephonyManager.SIM_STATE_PIN_REQUIRED :sb.append("需要PIN解锁");break; case TelephonyManager.SIM_STATE_PUK_REQUIRED :sb.append("需要PUK解锁");break; case TelephonyManager.SIM_STATE_READY :sb.append("良好");break; }