net.rim.blackberry.api.phone.phonelogs
Class PhoneLogs

java.lang.Object
  extended by net.rim.blackberry.api.phone.phonelogs.PhoneLogs

public final class PhoneLogs
extends Object

A container to maintain a list of CallLog objects that together represent the call log for phone calls stored in the message list.

Call logs are stored in two folders: One for missed calls, and one for all other calls.

Once you have retrieved an instance of the PhoneLogs object using the PhoneLogs.getInstance() method, you can use the object to add, delete, or change CallLog objects from the log.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

Field Summary
Category: Signed static long FOLDER_MISSED_CALLS
          Folder ID for the missed call folder.
Category: Signed static long FOLDER_NORMAL_CALLS
          Folder ID for other calls.
 
Method Summary
Category: Signed  void addCall(CallLog call)
          Adds a call to the log.
Category: Signed static void addListener(PhoneLogListener listener)
          Registers a PhoneLogListener instance with the system.
Category: Signed  CallLog callAt(int index, long folderID)
          Retrieves a particular call from the log by index.
Category: Signed  void deleteCall(int index, long folderID)
          Deletes a call from the log.
Category: Signed static PhoneLogs getInstance()
          Retrieves an instance of the call log.
Category: Signed  int numberOfCalls(long folderID)
          Retrieves the number of calls in a given call log folder.
Category: Signed static void removeListener(PhoneLogListener listener)
          Removes a registered PhoneLogListener instance from the system.
Category: Signed  void swapCall(CallLog call, int index, long folderID)
          Replaces the call at the given index with a new call.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

FOLDER_MISSED_CALLS

public static final long FOLDER_MISSED_CALLS
Folder ID for the missed call folder.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

FOLDER_NORMAL_CALLS

public static final long FOLDER_NORMAL_CALLS
Folder ID for other calls.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0


Method Detail

getInstance

public static PhoneLogs getInstance()
Retrieves an instance of the call log.

This object contains all the calls that appear in the message list.

Returns:
Handle to the call log.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

addCall

public void addCall(CallLog call)
Adds a call to the log.

The call appears in the message list for viewing.

Parameters:
call - Call to be added.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

swapCall

public void swapCall(CallLog call,
                     int index,
                     long folderID)
Replaces the call at the given index with a new call.

The new call replaces the old call in the message list.

Parameters:
call - New call to add to the log.
index - Index of the call to be replaced, from 0 to (PhoneLogs.numberOfCalls(long) - 1).
folderID - ID of the folder containing the call to replace (PhoneLogs.FOLDER_MISSED_CALLS or PhoneLogs.FOLDER_NORMAL_CALLS). You can only replace a missed call to the missed call folder and vice versa.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

deleteCall

public void deleteCall(int index,
                       long folderID)
Deletes a call from the log.

The call will be removed from the appropriate list.

Parameters:
index - Index of the call log to delete, from 0 to (PhoneLogs.numberOfCalls(long) - 1).
folderID - ID of the folder containing the call log to delete (PhoneLogs.FOLDER_MISSED_CALLS or PhoneLogs.FOLDER_NORMAL_CALLS).
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

numberOfCalls

public int numberOfCalls(long folderID)
Retrieves the number of calls in a given call log folder.

Parameters:
folderID - ID of the folder to check (PhoneLogs.FOLDER_MISSED_CALLS or PhoneLogs.FOLDER_NORMAL_CALLS).
Returns:
Number of calls currently in the log.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

callAt

public CallLog callAt(int index,
                      long folderID)
Retrieves a particular call from the log by index.

Parameters:
index - The index of the call in the phone log, from 0 to (PhoneLogs.numberOfCalls(long) - 1).
folderID - ID of the folder from which to retrieve the call (PhoneLogs.FOLDER_MISSED_CALLS or PhoneLogs.FOLDER_NORMAL_CALLS).
Returns:
The CallLog object at the index, if it exists. Either PhoneCallLog or ConferencePhoneCallLog.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

addListener

public static void addListener(PhoneLogListener listener)
Registers a PhoneLogListener instance with the system.

Parameters:
listener - The listener to register.
Throws:
NullPointerException - if the input listener to register is null.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

removeListener

public static void removeListener(PhoneLogListener listener)
Removes a registered PhoneLogListener instance from the system.

Parameters:
listener - The listener instance to remove.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal