How to make my own custom dialer in an Android phone
Asked Answered
B

3

9

In my application I add an intent so that the user can call:

str="tel:"+phoneArray[11];  
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(str));
startActivity(intent);

Then it calls from Android phone but I want to set up another custom dialer with a different look. What do need to do? I do not mean how to design the dialer, but only how to make a UI that will enter the number and execute a call.

Bach answered 24/4, 2012 at 17:41 Comment(1)
Here you can find a custom dialer : github.com/Ali-Rezaei/PadLayoutEberly
T
12

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 take the official phone app as reference. But be warned, it is no trivial task.

You can replace only the Dialer that way. The actual calling thing (what you see during calls) can't be changed.

For more information, see Stack Overflow question Android dialer application.

Trivia answered 24/4, 2012 at 17:47 Comment(1)
How about this scenario: I have web service with authentication which is capable of initiating call between two numbers through VoIP platform. Two parameters it accepts are caller and callee numbers. Would it be enough to have an app with activity which reponds to DIAL intents. I assume Android would offer me to set up which App I want use for dialing once I click number on the phonebook...? If so...how would I pass this number to my activity from phonebook?Webfooted
V
3

If you want to totally replace the existing phone dialler and manage the call from within your application then the answer is that this can't be done except on custom ROM you build after changing the android source code replacing the default dialler with your own.

Volturno answered 7/3, 2014 at 18:6 Comment(4)
since API 23 it is possible, see https://mcmap.net/q/456023/-replacing-default-phone-app-on-android-6-and-7-with-incallservice and https://mcmap.net/q/454594/-answer-incoming-call-using-android-telecom-and-incallserviceRaber
@Raber it would be great if simple-phone were translated into usual java. I have tried Decompile Kotlin to Java from Menu > Tools > Kotlin -> Decompile Kotlin to Java, but I had no success, because I do not have enough knowledge to do it. When the code is decompiled, there is some extra code that is not supported in usual java.Anode
@AlitonOliveira there are some Java forks, for example github.com/Abror96/CustomPhoneDialerRaber
There was a compile error regarding to compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.2.31. This command was missing: implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21".Anode
M
2

You can place an overlay over the actual phone call when it shows up. There are loads of phone skin apps like this

Myelencephalon answered 21/12, 2017 at 8:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.