对于单 SIM 卡,以下代码有效:
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String imei= tm.getDeviceId();
对于双 SIM 卡,我尝试了以下链接中的代码:
Android : Check whether the phone is dual SIM
但它对我不起作用。
如果有任何其他可能的解决方案,请告诉我。
最佳答案
尝试使用 getDeviceId(int slotId)
在 API 级别 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
关于android - 以编程方式在android中检索双SIM卡的IMEI号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22524413/