Muthu Ramadoss wrote:
> Is there a way to look up the user phone number other than TelephonyManager?
>
> In my G1, this returns null:
>
> // get your phone number
> TelephonyManager telephonyManager = (TelephonyManager)
> getSystemService(Context.TELEPHONY_SERVICE);
> String tel = telephonyManager.getLine1Number();
>
> Log.i("Telephone Number ==> ", tel+" <==");
Not only does this apparently return null in some cases (like you got),
it does not have to necessarily return a valid value.
I tried your code, and I get a phone number that I *think* is what I was
originally assigned when I bought the G1, before my other T-Mobile
number could be ported over.
So I am not certain this method is reliable in any case.
> Is there any other way of getting user's own phone number?
Hopefully yes, though I don't know of one...
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android App Developer Books: http://commonsware.com/books.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---