I am figuring out a way to replace the default dialer application from my custom dialer application, but I am not getting how to achieve this.
Here is what I want
I am referring to public static final String ACTION_DIAL.
Dialer is an Android system application that provides a distraction-optimized (DO) experience for Bluetooth calling, contact browsing, and call management. A fully functional implementation of Dialer is provided in the Android Open Source Project (AOSP).
Tap Apps & Notifications. Tap Advanced. Tap Default Apps. Under Default Apps, you will find 'Phone App' which you can tap to change the default.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With