简体   繁体   English

如何在Android手机中制作我自己的自定义拨号器

[英]How to make my own custom dialer in an Android phone

In my application I add an intent so that the user can call: 在我的应用程序中,我添加了一个intent,以便用户可以调用:

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. 然后它从Android手机调用,但我想设置另一个具有不同外观的自定义拨号器。 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. 我不是指如何设计拨号器,而只是如何设置一个将输入数字并执行呼叫的UI。

Create an app that responds to Intent.ACTION_DIAL . 创建一个响应Intent.ACTION_DIAL的应用程序。 In the AndroidManifest.xml you need to add the following to that Activity: AndroidManifest.xml您需要将以下内容添加到该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 . 有关更多信息,请参阅Stack Overflow问题Android拨号程序应用程序

如果你想完全替换现有的电话拨号器并在你的应用程序中管理呼叫,那么答案是,除了你在更改用自己的默认拨号器替换默认拨号器的android源代码后构建的自定义ROM之外,这是无法完成的。

You can place an overlay over the actual phone call when it shows up. 当显示时,您可以在实际的电话上叠加覆盖。 There are loads of phone skin apps like this 有很多像这样的手机皮肤应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM