Programmatically retrieve IMEI number for dual SIM in android

后端 未结 12 1146
一生所求
一生所求 2020-12-05 15:19

For single SIM following code works:

TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String imei= tm.getDeviceId();
12条回答
  •  萌比男神i
    2020-12-05 15:52

    Try using getDeviceId(int slotId) added in API level 23.

    Returns the unique device ID of a subscription, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available.

    Requires Permission: READ_PHONE_STATE

提交回复
热议问题