How to make a phone call in android

We are able to make a phone call in android via intent. You need to write only three lines of code to make a phone call.


Example of phone call in android

activity_main.xml

Drag the EditText and Button from the pallete, now the activity_main.xml file will like this:

File: activity_main.xml

Write the permission code in Android-Manifest.xml file

You need to write CALL_PHONE permission as given below:

File: Android-Manifest.xml

Activity class

Let's write the code to make the phone call via intent.

File: MainActivity.java


Install and Run the apk file on the Real Device (e.g. Mobile) to make the phone call.


Output:

android phone call example output 1

android phone call example output 2





Contact US

Email:[email protected]

Phone Call
10/30