--ADVERTISEMENT--

In this tutorial, you will learn to get own phone number or application running device phone number programmatically in android. To get and display phone number programmatically in android you have to write little bit java code and in this example I am going to show to get phone number of android app running device with simple way s. This may not work for everyone.

Related:
How to Make a Phone Call in Android by Entering any Number
How to Make a Phone Call in Android
How to Pick an Image From SD Card Gallery and Display in Android App


Android Example: Get Phone Number Programmatically in Android


Following is the content of XML layout file and java activity file to get and display phone number programmatically.

res/layout/get_phone_numbrer.xml

src/AndroidPhoneNumber.java

res/values/strings.xml

AndroidManifest.xml File

Make sure you have to add permission in AndroidManifest.xml file and the content of AndroidManifest.xml will look like this.



Now, run your How to Get the Phone Number Programmatically in Android using real device you will see your phone number in the screen.

Post a Comment

Powered by Blogger.