如何在手机响铃时或之前开启活动?

时间:2021-10-25 15:05:55

On blackberries, are there any exposed events that you can hook into that occur just before and after the phone rings?

在黑莓上,是否有任何暴露的事件可以在电话响铃之前和之后发生?

e.g. could you override the ring setting on the fly and NOT have it ring if the number is 999-9999?

例如如果数字是999-9999,你可以动态覆盖戒指设置而不是响铃吗?

1 个解决方案

#1


Yes very possible. You need to hook into the "Phone Events" and create a phone listener. The docs give some hints on this. so fire up your favorite Java IDE and rock on!

是的非常可能。您需要挂钩“电话活动”并创建电话听众。文档给出了一些暗示。所以启动你最喜欢的Java IDE并坚持下去!

http://na.blackberry.com/eng/deliverables/1076/development.pdf (look around page 190)

http://na.blackberry.com/eng/deliverables/1076/development.pdf(查看第190页)

Listen for phone events.     >Implement the PhoneListener interface.
Register the phone listener. >Invoke Phone.addPhoneListener().
Remove a phone listener.     >Invoke removePhoneListener().

When a new call arrives it uses the callIncoming(int) callback. There are a bunch more:

当新呼叫到达时,它使用callIncoming(int)回调。还有更多:

    A call is added to a conference call.
    callAdded(int)

    A BlackBerry® device user answers a call (user driven).
    callAnswered(int)

    A conference call is established.
    callConferenceCallEstablished(int)

    The network indicates a connected event (network driven).
    callConnected(int)

    A direct-connect call is connected.
    callDirectConnectConnected(int)

    A direct-connect call is disconnected.
    callDirectConnectDisconnected(int)

    A call is disconnected.
    callDisconnected(int)

    A BlackBerry device user ends the call.
    callEndedByUser(int)

    A call fails.
    callFailed(int, int)

    A new call arrives.
    callIncoming(int)

    The BlackBerry device initiates an outgoing call.
    callInitiated(int)

    A call is removed from a conference call.
    callRemoved(int)

    A held call resumes.
    callResumed(int)

    A call is waiting.
    callWaiting(int)

    A conference call is ended (all members are disconnected).
    conferenceCallDisconnected(int)

#1


Yes very possible. You need to hook into the "Phone Events" and create a phone listener. The docs give some hints on this. so fire up your favorite Java IDE and rock on!

是的非常可能。您需要挂钩“电话活动”并创建电话听众。文档给出了一些暗示。所以启动你最喜欢的Java IDE并坚持下去!

http://na.blackberry.com/eng/deliverables/1076/development.pdf (look around page 190)

http://na.blackberry.com/eng/deliverables/1076/development.pdf(查看第190页)

Listen for phone events.     >Implement the PhoneListener interface.
Register the phone listener. >Invoke Phone.addPhoneListener().
Remove a phone listener.     >Invoke removePhoneListener().

When a new call arrives it uses the callIncoming(int) callback. There are a bunch more:

当新呼叫到达时,它使用callIncoming(int)回调。还有更多:

    A call is added to a conference call.
    callAdded(int)

    A BlackBerry® device user answers a call (user driven).
    callAnswered(int)

    A conference call is established.
    callConferenceCallEstablished(int)

    The network indicates a connected event (network driven).
    callConnected(int)

    A direct-connect call is connected.
    callDirectConnectConnected(int)

    A direct-connect call is disconnected.
    callDirectConnectDisconnected(int)

    A call is disconnected.
    callDisconnected(int)

    A BlackBerry device user ends the call.
    callEndedByUser(int)

    A call fails.
    callFailed(int, int)

    A new call arrives.
    callIncoming(int)

    The BlackBerry device initiates an outgoing call.
    callInitiated(int)

    A call is removed from a conference call.
    callRemoved(int)

    A held call resumes.
    callResumed(int)

    A call is waiting.
    callWaiting(int)

    A conference call is ended (all members are disconnected).
    conferenceCallDisconnected(int)