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.

o_O
  • 5,527
  • 12
  • 52
  • 90

3 Answers3

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.

Community
  • 1
  • 1
zapl
  • 63,179
  • 10
  • 123
  • 154
  • 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? – azec-pdx Feb 03 '15 at 16:04
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.

mixel
  • 25,177
  • 13
  • 126
  • 165
  • 2
    since API 23 it is possible, see https://stackoverflow.com/a/49835987/1916449 and https://stackoverflow.com/a/49856583/1916449 – arekolek May 16 '18 at 22:22
  • @arekolek 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**. – Aliton Oliveira Apr 05 '19 at 19:27
  • 1
    @AlitonOliveira there are some Java forks, for example https://github.com/Abror96/CustomPhoneDialer – arekolek Apr 06 '19 at 08:01
  • 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"`. – Aliton Oliveira Apr 06 '19 at 16:40
2

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

ooo
  • 21
  • 1