Troubleshooting guide

187
12: Using the phone application
Listen for phone events
To act on a particular event, implement one of the following methods.:
Access and use call logs
Task Steps
Listen for phone events. > Implement the PhoneListener interface.
Register the phone listener. >Invoke Phone.addPhoneListener().
Remove a phone listener. >Invoke removePhoneListener().
Event Method
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 a call.
callEndedByUser(int)
A call fails.
callFailed(int, int)
A call goes on hold.
callHeld(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 ends (all members are disconnected).
conferenceCallDisconnected(int)
Task Steps
Retrieve a phone log. The PhoneLogs class represents the phone call history and provides methods for opening, adding,
deleting, or swapping call logs.
>Invoke PhoneLogs.getInstance().
PhoneLogs _logs = PhoneLogs.getInstance();
Retrieve the number of normal or missed
calls.
Two phone log folders exist: FOLDER_NORMAL_CALLS and FOLDER_MISSED_CALLS.
>Invoke numberOfCalls(int).
int numberOfCalls = _logs.numberOfCalls(FOLDER_NORMAL_CALLS);
Retrieve a call log. You can instantiate two types of call logs: PhoneCallLog objects, which have only one
participant, and
ConferencePhoneCallLog objects, which have two or more participants.
>Invoke PhoneLogs.callAt(int index, long folderID).
PhoneCallLog phoneLog = (PhoneCallLog)_logs.callAt(0);