check By Imsi IDS - Android Hardware

Android examples for Hardware:Sim Card

Description

check By Imsi IDS

Demo Code

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

public class Main {
  private static String[] kKNOWN_IMSI_IDS = { "310260000000000" };

   static Boolean checkByImsiIDS(Context context) {
    TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    String imsiid = telephonyManager.getSubscriberId();
    for (String knowimsi : kKNOWN_IMSI_IDS) {
      if (knowimsi.equalsIgnoreCase(imsiid)) {
        return true;
      }// ww w  .j a va 2 s.  c  o  m
    }
    return false;
  }
}

Related Tutorials