问题描述
我想获得其中插入装置的SIM卡的移动电话号码。我知道作为公关Android SDK中 TelephoneManger
是类,使我们可以通过 getLine1Number()
方法得到它。但它总是返回空值。
I want to get the mobile number of a sim which is inserted into the device. I know as pr the android SDK TelephoneManger
is the class by which we can get it by getLine1Number()
method. but it always returns null values.
查询:
- 在我能得到来自移动电话号码设备?
- 它是一个取决于SIM卡,或在某些情况下,还与设备相关的?
- 在任何其他方式从设备获得的手机号码?
- Can i get mobile number fromdevice?
- Is it a sim dependent or in some casealso device dependent?
- Any other ways to get the mobile number from device?
推荐答案
您使用的是正确的,并提供给普通用户(据我所知)的唯一方法。它主要取决于SIM卡(它不是强制性的有),并且在一些情况下都可以是设备相关的(getLine1Number()不正确地实现)。
You are using correct and the only approach available to the common user (AFAIK). It is mainly SIM dependent (it is not obligatory to have ), and in some cases may be device dependent (getLine1Number() not correctly implemented).
要更precise,IMSI唯一地识别SIM卡。但MSISDN(用户号)不是唯一涉及SIM卡的,因为它有可能改变的MSISDN上的SIM卡。网络可以使用IMSI从SIM卡中找到MSISDN在HLR和建立呼叫。
To be more precise, IMSI uniquely identifies SIM. But MSISDN (the subscriber number) is not uniquely related to SIM, as it is possible to change MSISDN on the SIM. Network may use IMSI from SIM to find MSISDN in the HLR and establish the call.
所以,MSISDN不是强制性的是在SIM
So, MSISDN is not mandatory to be on the SIM.
这篇关于从实际的设备获取手机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!