Opening phone dialer from an Android application

June 24, 2012

Phone dialer is an activity available with Android operating system to call a number. In this article, we will create an application which invokes the dialer on a button click.  Android system provides a standard action name called “ACTION_DIAL” to invoke the dialer. We will make use this action to invoke the the dialer from our application.

1. Create a new Android project namely “DialerDemo”

New Android Project

Figure 1 : New Android Project

2. Select build target for the application

Android Build Target

Figure 2: Android Build Target


3. Enter application details

Application Details

Figure 3: Application Details

4. res/values/strings.xml

<?xml version="1.0" encoding="utf-8"?>
    <string name="hello">Hello World, MainActivity!</string>
    <string name="app_name">DialerDemo</string>
    <string name="dialer">Open Dialer</string>

5. res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
    android:orientation="vertical" >

    android:text="@string/dialer" />


6. src/in/wptrafficanalyzer/dialerdemo/

package in.wptrafficanalyzer.dialerdemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

        /** Referring to the button object of the main.xml layout */
        Button btn  = (Button) findViewById(;

        /**    Defining a click event listener    */
        OnClickListener listener = new OnClickListener() {
            public void onClick(View v) {
                /** Creating an intent with the dialer's action name  */
                /** Since the intent is created with activity's action name, the intent is an implicit intent */
                Intent intent = new Intent("android.intent.action.DIAL");

                /** Starting the Dialer activity */

        /** Setting click event listener for the buttonS */

%MINIFYHTMLe6e1704b91630f847cf6d75f30ca0d6110%7. Application in execution
Main Activity

Figure 4: Main Activity

  • On clicking the button "Open Dialer", the given below "Phone Dialer" will be opened"
Dialer Activity

Figure 5: Dialer Activity

8. Download

9. Reference

How to hire me?

I am George Mathew, working as software architect and Android app developer at

You can hire me on hourly basis or on project basis for Android applications development.

For hiring me, please mail your requirements to

My other blogs

Android Knowledge Quiz

Ready to test your knowledge in Android? Take this quiz :

Tags: , ,

One Response to Opening phone dialer from an Android application

  1. abhinav aggarwal on August 22, 2014 at 11:19 pm

    i want to know that how to pass contact no also to the dialer .
    not just open but also to pass the number

Leave a Reply

Your email address will not be published. Required fields are marked *

Be friend at g+

Subscribe for Lastest Updates

FBFPowered by ®Google Feedburner