A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
how to get phone number from my app?
Joined: Feb 10, 2012
Mar 17, 2012 10:42:29
is it possible to retrieve my mobile number through my andriod app?
if so please suggest
Joined: Jul 25, 2011
Apr 06, 2012 05:21:51
The following code would do!. But be sure to insert Null Checks for the result.
phoneNo = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getLine1Number();
Also insert the following permission in AndroidManifest file.
Joined: Mar 12, 2008
May 04, 2012 03:13:31
I have used the same and in emulator it shows one 9 digit number . In android phone application crashes and shows "The application(process xxx.xxx.xxx) has stopped unexpectedly. please try again.
Any solution would be greatly appreciated.
Joined: Jun 02, 2011
May 14, 2012 07:40:09
Yeah, the one by Mohan Prasath will work. It would not work on an emulator because it does not support any sort of wireless connectivity. It would work on your phone
subject: how to get phone number from my app?
capturing windows app's output
Reflection got at field editing exception
To get a number from html page
How this app working?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015