拦截黑莓手机中的拨出电话

发布于 2024-08-05 16:56:40 字数 216 浏览 6 评论 0 原文

我们正在寻找一种方法来执行以下操作:

  • 带有 BB 的用户输入一个号码(或选择一个联系人并单击“发送”)
  • 我们的应用程序在后台检测到呼叫事件
  • 我们的应用程序执行某些操作(例如阻止呼叫/拨打电话)到不同的号码等)

这可以完成吗?是否可以对用户透明地完成(即没有对话或用户参与)? 我应该查看哪些 API?

谢谢

we are looking for a way to do the following:

  • user with BB enters a number (or selects a contact and clicks 'send')
  • our app in the background detects the call event
  • our app does something (e.g. blocks the call / makes a call to a different number, etc)

can this be done at all? can it be done transparently to the user (i.e. no dialogs or user involvement)?
which APIs should I look at?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羁客 2024-08-12 16:56:40

拨出呼叫拦截

呼叫拦截 http://img200.imageshack.us/img200/6927/callinit。 png

应针对已知问题代码 示例:

import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneListener;
import net.rim.device.api.system.Application;
import net.rim.device.api.ui.component.Dialog;

public class CatchCall extends Application implements PhoneListener {
    public CatchCall() {
        Phone.addPhoneListener(this);
    }
    public static void main(String[] args) {
        new CatchCall().enterEventDispatcher();
    }
    public void callAdded(int callId) {
    }
    public void callAnswered(int callId) {
    }
    public void callConferenceCallEstablished(int callId) {
    }
    public void callConnected(int callId) {
    }
    public void callDirectConnectConnected(int callId) {
    }
    public void callDirectConnectDisconnected(int callId) {
    }
    public void callDisconnected(int callId) {
    }
    public void callEndedByUser(int callId) {
    }
    public void callFailed(int callId, int reason) {
    }
    public void callHeld(int callId) {
    }
    public void callIncoming(int callId) {
    }
    public void callInitiated(int callid) {
        Dialog.inform("call initiated");
    }
    public void callRemoved(int callId) {
    }
    public void callResumed(int callId) {
    }
    public void callWaiting(int callid) {
    }
    public void conferenceCallDisconnected(int callId) {
    }
}

取消呼叫

您可以使用事件注入来触发关闭按钮按下事件:

public void dropCall()
{
    KeyEvent inject = new KeyEvent(KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
    inject.post();
}

不要忘记设置设备释放的权限: 选项 =>高级选项 =>应用=> [您的应用程序] => 编辑默认权限 => 交互 => 击键注入

另请参阅
BlackBerry - 模拟按键事件

Outgoing call interception

call interception http://img200.imageshack.us/img200/6927/callinit.png

Code example:

import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneListener;
import net.rim.device.api.system.Application;
import net.rim.device.api.ui.component.Dialog;

public class CatchCall extends Application implements PhoneListener {
    public CatchCall() {
        Phone.addPhoneListener(this);
    }
    public static void main(String[] args) {
        new CatchCall().enterEventDispatcher();
    }
    public void callAdded(int callId) {
    }
    public void callAnswered(int callId) {
    }
    public void callConferenceCallEstablished(int callId) {
    }
    public void callConnected(int callId) {
    }
    public void callDirectConnectConnected(int callId) {
    }
    public void callDirectConnectDisconnected(int callId) {
    }
    public void callDisconnected(int callId) {
    }
    public void callEndedByUser(int callId) {
    }
    public void callFailed(int callId, int reason) {
    }
    public void callHeld(int callId) {
    }
    public void callIncoming(int callId) {
    }
    public void callInitiated(int callid) {
        Dialog.inform("call initiated");
    }
    public void callRemoved(int callId) {
    }
    public void callResumed(int callId) {
    }
    public void callWaiting(int callid) {
    }
    public void conferenceCallDisconnected(int callId) {
    }
}

Cancel call

You can use event injection to fire Close button press event:

public void dropCall()
{
    KeyEvent inject = new KeyEvent(KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
    inject.post();
}

Don't forget to set permissions for device release: Options => Advanced Options => Applications => [Your Application] =>Edit Default permissions =>Interactions =>key stroke Injection

See also
BlackBerry - Simulate a KeyPress event

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文