Wednesday, September 15, 2010

[android-developers] TelephonyManager getLine1Number() returns 10 or 11 characters?

It seems this code:
//*******************************************
TelephonyManager mTelephonyMgr =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

phoneID = mTelephonyMgr.getLine1Number();
//********************************

returns different "phone number format" on different devices.
Specifically:
Motorlola droid from Verizon returns: 7805639999 (length 10)
AVD with HVGA skin returns: 15555218135 (length 11)
Samsung Galaxy from AT&T returns: 17805639998 (length 11)

I can get rid of the leading "1" where it exists or I can add "1" to
make them all the same if this is all inclusive of what is returned.

What should I expect in variation from this routine?

Thanks, John Brown

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate