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
- config_defaultDialer in frameworks/base/core/res/res/values/config.xml
- incall_default_class in packages/services/Telecomm/res/values/config.xml
- 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
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);
}
}Give your application permission to call in AndroidManifest
<uses-permission android:name="android.permission.CALL_PHONE" />
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
Android Appcompat-V7:21.0.0 Change Material Checkbox Colors
Android - Multi-Line Linear Layout
How to Change Separator Color in Navigationview
What Is the Equivalent of Actionbar in Earlier Sdk Versions
How to Send a Simple Email Programmatically? (Exists a Simple Way to Do It)
How to Draw Road Directions Between Two Geocodes in Android Google Map V2
How to Display Border to Imageview
Android E/Parcel﹕ Class Not Found When Unmarshalling (Only on Samsung Tab3)
How to Change Package Name in Android Studio
Android Circular Determinate Progressbar
Detect If an App Is Installed from Play Store
How to Change the Color of the Tabs Indicator Text in Android
Do Geofences Remain Active in Android After a Device Reboot
Android Sd Card Write Permission Using Saf (Storage Access Framework)
Differencebetween Src and Background of Imageview
Android Studio Create Project Template for New Projects
Preventing/Catching "Illegalargumentexception: Parameter Must Be a Descendant of This View" Error