Android的拨号器应用程序 [英] Android dialer application

查看:206
本文介绍了Android的拨号器应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找出一个办法来取代从我的自定义拨号器应用程序默认的拨号器应用程序,但我没有得到如何实现这一点。

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.

下面是我想要的。

  • 创建一个自定义的拨号界面
  • 在我的应用程序时,要调用呼叫按钮硬件或一个在Android是pressed
  • 在该应用程序也可以从联系人屏幕名为

我指的是* 公共静态最后弦乐ACTION_DIAL *。

推荐答案

这是一种复杂的问题,但是......

It's kind of complex question but....

  1. 创建一个简单的Andr​​oid应用程序(我们的拨号器)。要真正叫人,你只需要一个方法:

  1. 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);
    }
}

  • 为您的应用程序许可AndroidManifest叫

  • Give your application permission to call in AndroidManifest

    <uses-permission android:name="android.permission.CALL_PHONE" />
    

  • 坐落在AndroidManifest的意图,说你的电话的时候需要一个拨号器使用你的应用程序

  • Set in AndroidManifest intention that says to your phone to use your app when need a dialer

    当有人preSS呼叫按钮:

    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>
    

    当有人触发一个URI:

    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>
    

    这篇关于Android的拨号器应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆