File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes android how to obtain the phone number of the machine through the interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "android how to obtain the phone number of the machine through the interface?" Watch "android how to obtain the phone number of the machine through the interface?" New topic
Author

android how to obtain the phone number of the machine through the interface?

Regen Mark
Greenhorn

Joined: Mar 14, 2012
Posts: 6
android how to obtain the phone number of the machine through the interface?
anyone can help me?
Mohan Prasath
Ranch Hand

Joined: Jul 25, 2011
Posts: 38

Most of the time the following code would return null or your old SIM number. But it works some times

String phoneNo = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getLine1Number();

You have to give the following permission in the AndroidManifest <uses-permission android:name="android.permission.READ_PHONE_STATE"/>


With regards,
Mohan Prasath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: android how to obtain the phone number of the machine through the interface?
 
Similar Threads
How to get the phone number of native for android?
How this app working?
Calls trough interface references are slower (on Android)
Android: Microsoft Exchange
how install in Eclipse(Java/Android) emulator for Tablet PC Android