Reputation: 1307
i want to write an application to fetch call history from a black berry 10. Can any body guide me which API i can use.
Upvotes: 0
Views: 322
Reputation: 3065
This can be done using the CallHistoryService API available in OS 10.3.0
Here is some sample code to fetch all calls and output the numbers to the log:
CallHistoryService callHistoryService;
// The ID of a valid account is required
bb::pim::account::Account defaultAccount =
callHistoryService.defaultAccount();
// The default filter will return all calls
CallHistoryFilter defaultFilter;
// Contact search can be used to identify the contacts
CallHistoryParam callHistoryParams;
callHistoryParams.setContactSearchEnabled(false);
QList<CallEntryResult> callHistoryResults =
callHistoryService.callHistory(
defaultAccount.id(),
defaultFilter,
callHistoryParams);
foreach (const CallEntryResult &callEntryResult, callHistoryResults) {
CallEntry callEntry = callEntryResult.call();
qDebug << "Phone number: " << callEntry.phoneNumber();
}
Upvotes: 0
Reputation: 929
From the above link we can only display the default call log.
Upvotes: 2
Reputation: 346
Would using the invocation framework work for what you are trying to do? It seems there is a way to fetch the call log.
https://developer.blackberry.com/cascades/documentation/device_platform/invocation/phone.html
Upvotes: 1