[Solved] Getting the phone number of the phone

Put your problem here if it does not fit any of the other categories.

[Solved] Getting the phone number of the phone

Postby Nanodeath » Tue Jan 15, 2008 10:47 pm

Sorry if this has already been answered, but I haven't been able to find it. How does one get the phone number of the phone the application is running on? ...assuming the emulator supports that. I'd be sad if it didn't.

Thanks!
Last edited by Nanodeath on Tue Jan 15, 2008 11:29 pm, edited 1 time in total.
Nanodeath
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Jan 15, 2008 6:56 am

Top

Postby Nanodeath » Tue Jan 15, 2008 11:29 pm

Aha, I got it I think.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. String myNumber = android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_LINE1_NUMBER);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Thanks in part to the tutorial plusminus posted here.
Nanodeath
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Jan 15, 2008 6:56 am

Postby plusminus » Wed Jan 16, 2008 12:54 am

Hello Nanodeath,

the one you linked is very similar, but originally I posted it here: http://www.anddev.org/viewtopic.php?p=700#700

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Nanodeath » Wed Jan 16, 2008 1:03 am

Doh, that would have been handy! Might make use of those other fields as well in the future. Thanks for the pointer.
Nanodeath
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Jan 15, 2008 6:56 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests