拿到电话号码编程的机器人机器人、电话号码

2023-09-12 06:29:09 作者:立场简单

我现在用的是code

I am using the code

TelephonyManager tMgr =(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
  mPhoneNumber = tMgr.getLine1Number();

要拿到手机没有编程的机器人。但是,这是工作的罚款只有一个SIM卡。 如果我通过插入其他SIM卡测试这个code,这是给。我试图找到这个解决方案。请帮助我。我也包括READ_PHONE_STATE许可清单

to get the phone no programatically in android . But this is working fine only for one sim card. If i test this code by inserting other sim card, it is giving null. I am trying to find the solution for this. please help me. I have also included READ_PHONE_STATE permission in Manifest.

我想唯一识别SIM卡。是否有任何其他的方式来做到这一点。请让我知道。

I want to uniquely identify the sim card. IS there any other way to do this. please let me know.

在此先感谢...

推荐答案

我觉得辛序列号是唯一的。你可以试试这个。

I think Sim serial Number is unique. You can try this.

TelephonyManager telemamanger = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String getSimSerialNumber = telemamanger.getSimSerialNumber();

让我知道,如果有任何问题。

Let me know if there is any issue.