PhoneLogs
A container to maintain a list of CallLog objects that together represent the call log for phone calls stored in the message list.
Supported Platform(s)
- BlackBerry OS 5.0+ |
- Ripple Emulator |
API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
blackberry.phone.PhoneLogs.addPhoneLogListener | Y | Y | Y | Y | |||
blackberry.phone.PhoneLogs.callAt | Y | Y | Y | Y | |||
blackberry.phone.PhoneLogs.deleteCallAt | Y | Y | Y | Y | |||
blackberry.phone.PhoneLogs.find | Y | Y | Y | Y | |||
blackberry.phone.PhoneLogs.numberOfCalls | Y | Y | Y | Y | |||
FOLDER_MISSED_CALLS | Y | Y | Y | Y | |||
FOLDER_NORMAL_CALLS | Y | Y | Y | Y |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
You must declare the feature element(s) below in your configuration document: |
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
<feature id="blackberry.phone.Find" /> | Y | Y | Y | Y | |||
<feature id="blackberry.phone.PhoneLogs" /> | Y | Y | Y | Y |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Functions
static
Boolean
blackberry.phone.PhoneLogs.addPhoneLogListener
(onCallLogAdded: function(addedCallLog : blackberry.phone.PhoneLogs.CallLog), onCallLogRemoved: function(removedCallLog : blackberry.phone.PhoneLogs.CallLog), onCallLogUpdated: function(newCallLog : blackberry.phone.PhoneLogs.CallLog, oldCallLog : blackberry.phone.PhoneLogs.CallLog), onCallLogReset: function())
Registers PhoneLogListener to listen for call log events.
Register listeners when interested in receiving call log events. When you subscribe more than one callback function, every new callback set
will overwrite each previous. To unsubscribe from all callbacks, pass null as a parameter.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
onCallLogAdded |
This callback function is triggered when a new call log is added.
addedCallLog: Object that contains the CallLog that was added |
onCallLogRemoved |
This callback function is triggered when a call log is removed.
removedCallLog: Object that contains the CallLog that was removed |
onCallLogUpdated |
This callback function is triggered when a call log is updated.
newCallLog: Object that contains the CallLog that represents the new CallLog oldCallLog: Object that contains the CallLog that represents the old CallLog |
onCallLogReset | This callback function is triggered when a call log is reset. |
Return:
Returns true if the listener is assigned
Code Example:
|
static
CallLog
blackberry.phone.PhoneLogs.callAt
(index : Number, folderID : Number)
Retrieves a particular call from the appropriate log folder by index.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
index | The index of the call in the phone log, from 0 to numberOfCalls(folderID) - 1 |
folderID | ID of the folder from which to retrieve the call, (one of the FOLDER_* constants) |
Return:
Returns the CallLog specified by the index
Code Example:
|
static
Boolean
blackberry.phone.PhoneLogs.deleteCallAt
(index : Number, folderID : Number)
Deletes a call from the log. The call will be removed from the appropriate list.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
index | Index of the call log to delete, from 0 to numberOfCalls(folderID) - 1 |
folderID | ID of the folder containing the call log to delete (one of the FOLDER_* values). |
Return:
Returns true if the item was successfully deleted
Code Example:
|
static
CallLog[]
blackberry.phone.PhoneLogs.find
([filter : FilterExpression], [folderID : Number], [orderBy : String], [maxReturn : Number], [isAscending : Boolean])
This method lookup the CallLog that match the expression provided.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
filter | optional expression parameter that defines the search criteria for the find. If no value is provided all the Logs are suitable. |
folderID | optional 'folderID' parameter specifying the folder where to performed find. If 'folderID' is not supplied the search is made in the missed calls folder (FOLDER_MISSED_CALLS). |
orderBy | optional 'orderBy' parameter specifying the field which the results will be sorted by. If 'isAscending' is not supplied or 'isAscending' is true, the sort results will be in an ascending order. If 'isAscending' is false, the sort results will be in a descending order. |
maxReturn | optional integer parameter specifying the maximum number of results to return from the find. If not supplied or set to -1, it will return all results found. |
isAscending | optional 'isAscending' parameter specifying whether the sort order is ascending or descending. If not supplied or set to true, the results sorted by the field specified by 'orderBy' will be in an ascending order. If set to false, the sort results will be in a descending order. If no 'orderBy' value is specified, 'isAscending' is neglected. |
Return:
The function returns list of CallLogs that match search criteria
Code Example:
|
static
Number
blackberry.phone.PhoneLogs.numberOfCalls
(folderID : Number)
Retrieves the number of calls in a given phone log folder.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
folderID | ID of the folder to check (one of the FOLDER_* values). |
Return:
Returns number of calls
Code Example:
|