is Can Use Sim Card - Android android.telephony

Android examples for android.telephony:Sim Card

Description

is Can Use Sim Card

Demo Code

import android.content.Context;
import android.telephony.TelephonyManager;

public class Main {

  public static boolean isCanUseSim(Context context) {

    if (null == context) {
      return false;
    }/*  www. j  a  v  a 2  s  . co  m*/
    try {
      TelephonyManager mgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
      return TelephonyManager.SIM_STATE_READY == mgr.getSimState();
    } catch (Exception e) {
    }
    return false;
  }

}

Related Tutorials