Get SIM ID

After searching the API and lack of luck, does anyone know how I can get the device’s SIM card identifier?

thank,

rays.

+3
source share
3 answers

Here is the code to get the international mobile subscriber identification identifier (IMSI) and phone identifier (IMEI number) and Sim program number No.

Before doing this, also set the user rights in the manifest file "android.permission.READ_PHONE_STATE"

    TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    String imsi = mTelephonyMgr.getSubscriberId();
    String imei = mTelephonyMgr.getDeviceId(); 
    String simno = mTelephonyMgr.getSimSerialNumber();
    Log.v("", ""+imsi);
    Log.v("", ""+imei);
    Log.v("", ""+simno);
+5
source

Frrom wiki pedia

Id = (IIN) : (MII), 2 , 89 . , 1-3 , - E.164. , 1-4 .

API:

public String getSimCountryIso ()
public String getSimSerialNumber ()
public String getSubscriberId ()
+2

To get the IMSI (Subscriber Identity on the SIM card), use the getSubscriberId method in the TelephonyManager API .

+1
source

Source: https://habr.com/ru/post/1776048/


All Articles