Android examples for android.telephony:Sim Card
is Can Use Sim
import android.app.Activity; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Build; import android.os.Environment; import android.os.Vibrator; import android.telephony.TelephonyManager; public class Main{ public static boolean isCanUseSim(Context context) { try {/* w w w . j a v a2 s . co m*/ TelephonyManager mgr = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return TelephonyManager.SIM_STATE_READY == mgr.getSimState(); } catch (Exception e) { e.printStackTrace(); } return false; } }