How to Make My Own Custom Dialer in an Android Phone

Creating custom android dialer

Create an app that responds to Intent.ACTION_DIAL. In the AndroidManifest.xml you need to add the following to that Activity:

<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

You can read more in:

Android dialer application

Possible with Android to write custom dialer/in-call app to completely replace native Phone app?

Here is the telephony API summary.

Also here you can find a mini tutorial on how you can do it.

Creating own dialer

It was already answered here so you can use that for the custom dialer part:

as for the widget part, I find google's guide most helpful:
http://developer.android.com/guide/topics/appwidgets/index.html

How to set my custom dialer app as default dialer in AOSP

The query logic has changed and it's in packages/services/Telecomm/src/com/android/server/telecom/DefaultDialerCache.java

Resources resources = mContext.getResources();
mSystemDialerComponentName = new ComponentName(resources.getString(
com.android.internal.R.string.config_defaultDialer),
resources.getString(R.string.incall_default_class));

You should modify or overlay

  1. config_defaultDialer in frameworks/base/core/res/res/values/config.xml
  2. incall_default_class in packages/services/Telecomm/res/values/config.xml
  3. dialer_default_class in packages/services/Telecomm/res/values/config.xml

Is is possible to install own dialer application that will handle both incoming and outgoing calls?

The only application that is really able to trigger outgoing calls is the ROM Dialer application that comes with your Android OS. There are a couple of other apps out there, but they only trigger an intent which invokes the native dialer.


What does this mean for you?

Outgoing calls: You can write an application that checks if a number is in the whitelist for example, and which provides a simple, well-defined UI for elderly people. However, this application will then forward the call to the native dialer app. This is not a problem for what you want to achieve in general.

Incoming calls: You simply cannot replace the incoming call screen with your custom implementation. And there is no way of catching a call and forwarding it to your own app instead of the ROM dialer. This is for security reasons.


I tried to do something similar for a research project, where I wanted to provide a custom dialer application for patients suffering from Parkinson's disease. Unfortunately you were right with your guess that what you would like to achieve is only possible if you have root access to the phone.

Android dialer application

  1. Create a simple Android application (our dialer). To actually call someone, you just need that method:

    private void performDial(String numberString) {
    if (!numberString.equals("")) {
    Uri number = Uri.parse("tel:" + numberString);
    Intent dial = new Intent(Intent.ACTION_CALL, number);
    startActivity(dial);
    }
    }
  2. Give your application permission to call in AndroidManifest

    <uses-permission android:name="android.permission.CALL_PHONE" />
  3. Set in AndroidManifest intention that says to your phone to use your app when need a dialer

When someone press the call button:

    <intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

When someone fire an URI:

    <intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tel" />
</intent-filter>


Related Topics



Leave a reply



Submit