Click here to Skip to main content
Click here to Skip to main content

Android Tutorial - How To Make A Simple Phone Call Application

By , 21 Sep 2012
Rate this:
Please Sign up or sign in to vote.

Welcome to my Android tutorial. This time, I'd like to show you how to make a simple phone call application. Is that important? Yes, It is. Imagine, you're in danger, and you don't know what to do. So, what should you do? Call emergency number? Do you remember that number? Or, if you get accident, can you type the number correctly? It's a simple task. But it'll be easier and simpler if you can call a number with one touch. Let's see how to do that.

Create a new android project. First thing we should do is to add user permission in AndroidManifest.xml file so we can make a phone call using our app. See the highlighted code below:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
 package="com.blogspot.juniantr.phonecallsample" android:versionCode="1"

 <application android:icon="@drawable/icon" android:label="@string/app_name"
  <activity android:name=".PhoneCallSampleAct" android:label="@string/app_name">
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />

 <uses-permission android:name="android.permission.CALL_PHONE" />

Next, open the main.xml file and we'll change the user interface. We'll add a button to make a phone call.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
 android:orientation="vertical" android:layout_width="fill_parent"
 <Button android:layout_height="wrap_content" android:text="@string/call"
  android:layout_width="wrap_content" android:id="@+id/btnCall"></Button>

Open your activity java file (in my project, it's and add this code:

private void phoneCall()
   String phoneCallUri = "tel:911";
   Intent phoneCallIntent = new Intent(Intent.ACTION_CALL);

Finally, let's add the last touch so the app can running. Our scenario is simple. We just need press the button and it'll call 911. Here is the complete code:

package com.blogspot.juniantr.phonecallsample;

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

public class PhoneCallSampleAct extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        View callButton = findViewById(;
    private void phoneCall()
     String phoneCallUri = "tel:911";
     Intent phoneCallIntent = new Intent(Intent.ACTION_CALL);

 public void onClick(View v) {
  // TODO Auto-generated method stub

Here is a running sample:

Android Phone Call App Android Phone Call App

Okay, I think that's all I got today. See you in my next post Big Grin | <img src= " src="" />


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Junian Triajianto
Software Developer
Indonesia Indonesia
Just an ordinary geek.
For more information visit my blogs:
Junian Legacy
Kodefun, learning by coding
Follow on   Twitter   Google+

Comments and Discussions

QuestionEdit number in application PinmemberMember 1033380113-Oct-13 11:45 
GeneralGood code Pinmemberamon6526-Sep-12 19:43 
SuggestionImage link issue... PinmemberSandip.Nascar20-Sep-12 4:32 
Please could you use internal link for image to
This will make your blog more readable.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140421.2 | Last Updated 21 Sep 2012
Article Copyright 2012 by Junian Triajianto
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid