2012年3月20日 星期二

tm.getLine1Number() return null

注意,手机号码不是所有的都能获取。只是有一部分可以拿到。这个是由于移动运营商没有把手机号码的数据写入到sim卡中。这个就像是一个变量,当移动运营商为它赋值了,它自然就会有值。不赋值自然为空。这就是为什么很多人得不到本机号码的原因。


There is no guaranteed solution to this problem because the phone number is not physically stored on all SIM-cards, or broadcasted from the network to the phone. This is especially true in some countries which requires physical address verification, with number assignment only happening afterwards. Phone number assignment happens on the network - and can be changed without changing the SIM card or device (e.g. this is how porting is supported).




Reference :
Android 本机号码的获取
Get Phone Number in Android SDK

 

沒有留言:

張貼留言