android - 以编程方式在android中检索双SIM卡的IMEI号码

标签 android imei dual-sim

对于单 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/

相关文章:

Android 字符串资源存储在 ...\res\values\strings.xml 之外

java - 如何更改日历偏移量?

android - Android 设备的唯一 ID

android - 如何在 Android 10 中获取有关手机 IMEI 的信息?

安卓信号强度

android - 通过 adb shell/Tasker 关闭第二个 SIM - 使用 Activity/Intent

android - qt 传感器上的未定义引用

android - 如何将图像作为base64字符串发送到android webview当前页面

android - 监听 GSM 流量