Java tutorial
//package com.java2s; //License from project: Apache License import android.telephony.TelephonyManager; public class Main { private static String UNKNOWN = ""; /** * Returns a constant indicating the state of the default SIM card. * @param sim_state "getSimState()" */ public static String getSimStateStr(int sim_state) { switch (sim_state) { case TelephonyManager.SIM_STATE_UNKNOWN://0 return "SIM_STATE_UNKNOWN"; case TelephonyManager.SIM_STATE_ABSENT://1 return "SIM_STATE_ABSENT"; case TelephonyManager.SIM_STATE_PIN_REQUIRED://2 return "SIM_STATE_PIN_REQUIRED"; case TelephonyManager.SIM_STATE_PUK_REQUIRED://3 return "SIM_STATE_PUK_REQUIRED"; case TelephonyManager.SIM_STATE_NETWORK_LOCKED://4 return "SIM_STATE_NETWORK_LOCKED"; case TelephonyManager.SIM_STATE_READY://5 return "SIM_STATE_READY"; default: return UNKNOWN; } } }