拿到电话号码编程的机器人 [英] to get phone number programatically in android

查看:139
本文介绍了拿到电话号码编程的机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用的是code

I am using the code

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

要拿到手机没有编程的机器人。但是,这是工作的罚款只有一个SIM卡。 如果我通过插入其他SIM卡测试这个code,这是给。我试图找到这个解决方案。请帮助我。我也包括<一个href="http://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE"><$c$c>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.

这篇关于拿到电话号码编程的机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆