2011年9月3日

TelephonyManager | Android Developers

TelephonyManager | Android Developers:

TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
int sim_state = tm.getSimState();

SIM卡的狀態:
int SIM_STATE_UNKNOWN=0                   SIM card state: Unknown."
int SIM_STATE_ABSENT=1                         SIM card state: no SIM card is available in the device
int SIM_STATE_PIN_REQUIRED=2            SIM card state: Locked: requires the user's SIM PIN to unlock
int SIM_STATE_PUK_REQUIRED=3          SIM card state: Locked: requires the user's SIM PUK to unlock
int SIM_STATE_NETWORK_LOCKED=4 SIM card state: Locked: requries a network PIN to unlock
int SIM_STATE_READY=5                          SIM card state: Ready

沒有留言: