is Exist Sim Card - Android Hardware

Android examples for Hardware:Sim Card

Description

is Exist Sim Card

Demo Code


//package com.java2s;

import android.content.Context;

import android.telephony.TelephonyManager;

public class Main {
    public static boolean isExistSimCard(Context ctx) {
        TelephonyManager telManager = (TelephonyManager) ctx
                .getSystemService(Context.TELEPHONY_SERVICE);
        if (telManager.getSimState() != TelephonyManager.SIM_STATE_ABSENT) {
            return true;
        }/*from   w ww .j  av a2 s  .  c  om*/
        return false;
    }
}

Related Tutorials