开发者

Poll: Phone number in Android About -> Phone Identity and International Dialling Codes

Background; I am in the process of writing an Android messaging application that needs to know the current user's phone number. This is then used to connect to other users using the application.

My application relies on looking up the user's number from Android's Settings -> About Phone -> Phone identity -> Phone number (this can at times be blank.. but that is a separate problem).

I am assuming that the above Phone number contains the user's full number. ie, my UK Android phone shows my number as: +447832xxxxxxxx, where 44 is the UK's international dialling code and 7832 is t开发者_JAVA技巧he operator.

Is it safe to assume that all Androids phones would include the international dialling code, which starts with +?

I would be indebted if any Android users could have a quick look at their Android settings and confirm whether Phone number is displayed as +international code+operator+number, i.e. US Android sets start with +1xxxxxx.


TelephonyManager.getLine1Number() is not guaranteed to be correct or even available to applications. I'd suggest a backup plan of using SECURE_ID to match to some user entered, possibly text-message verified phone number on a server somewhere. But even SECURE_ID is sometimes not a unique identifier (all DROID2 phones have the same ID), which would mean you should rely on an account system of some sort.


In my phone (Nexus One, Android 2.2, O2 UK) I don't have Settings -> About Phone -> Phone identity. In Settings -> Status -> My phone number is "Unknown". Not sure this helps you though, sorry.


On my moto droid with 2.2 I have: Settings->About Phone->Status->My phone number. FYI it is not prefixed with +international code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜