Get IMSI Number of Android Dual SIM device

回眸只為那壹抹淺笑 提交于 2019-12-23 00:46:11

问题


I am currently using the android API

public static String get_IMSI_Number(Context context) {
    TelephonyManager tel = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    return tel.getSubscriberId();
}

to get the IMSI number.

But unfortunately it is not getting the IMSI number if the device is dual SIM and It is returning "null" always.

I want to get the IMSI number of the Device( For Dual SIM )

case 1: Need to read the IMSI numbers if the device inserted with two SIMS in it's two slots

case 2: Need to read the IMSI number if the device inserted with one SIM in it's first slot and second slot left unused/blank

case 3: Need to read the IMSI number if the device inserted with one SIM in it's second slot and first slot left unused/blank

I followed the link "Android : Check whether the phone is dual SIM" but not worked.

Can any one help me to sort it out.

Note:The solution should work in all android 4.0 and above versions and in all vendors(Samsung,motorola,HTC,Karbon etc).

Thanks in advance.

来源:https://stackoverflow.com/questions/31586086/get-imsi-number-of-android-dual-sim-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!