从采用Android SIM卡获取MSISDN [英] Get MSISDN from the SIM using Android

查看:2073
本文介绍了从采用Android SIM卡获取MSISDN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从SIM卡采用了Android的MSISDN,我已经试过 getLine1Number()但这只是返回的MSISDN储存在我的电话信息或所有者信息secction,如果这些信息是不存储,Android将返回空值。

I'm trying to retrieve the MSISDN from the SIM using Android, I have tried getLine1Number() but this only returns the MSISDN stored in My Phone Information or Owner Information secction, if these info is not stored, Android will return a null value.

你知道任何工作围绕这个?或者是有办法得到了MSISDN从SIM卡号码( getSimSerialNumber())?

Do you know any work around from this? or is there a way to derive the MSISDN from the SIM number (getSimSerialNumber())?

等待一个坚实的回答一如既往! :)

Awaits a solid Answer as always !!! :)

推荐答案

MSISDN (又名手机号码)不是一个SIM卡的数据,这样你就无法恢复。 SIM卡的IMSI(国际移动Subsriber身份)被发送到HLR(归属位置寄存器),负责做好测绘的 MSISDN / IMSI 的。 移动电话运营商可以存储MSISDN在SIM卡上,如果他们想,但由于它不要求在GSM协议是不

The MSISDN (aka the mobile phone number) isn't a SIM data, so you can't retrieve it. The SIM card has an IMSI (International Mobile Subsriber Identity) that is sent to the HLR (Home Location Register) in charge of doing the mapping MSISDN/IMSI. Mobile phone operators could store the MSISDN on the SIM card if they wanted to, but since it is not required in the GSM protocol it isn't.

抱歉!

有关更多信息看这个讨论<一个href="http://groups.google.com/group/android-developers/browse_thread/thread/f6aeef55f1e8d2c7">Getting电话号码也如何机器人获得MSISDN

For more info look at this discussion Getting phone number also How android get MSISDN

编辑:

要得到IMSI号码,

 TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
 String imsi = mTelephonyMgr.getSubscriberId();

但也有少数手机只返回6位而不是15所以,你可以使用,

but a few handsets only return 6 digits instead of 15. So, you can use,

根据这篇文章:<一个href="http://www.anddev.org/tinytut_-_getting_the_imsi_-_imei_sim-device_unique_ids-t446.html">http://www.anddev.org/tinytut_-_getting_the_imsi_-_imei_sim-device_unique_ids-t446.html

String imei = android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);

有关更多信息看该课题和的class SystemProperties

这篇关于从采用Android SIM卡获取MSISDN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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