diff -r 913c9751c067 -r 716254ccbcc0 org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-CF55DBA3-2D4C-4FD0-8A06-862E6128F4E7.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-CF55DBA3-2D4C-4FD0-8A06-862E6128F4E7.html Fri Mar 05 19:11:15 2010 -0800 @@ -0,0 +1,87 @@ + + +Accessing +device logs

Accessing +device logs

+

The Logging Service +API allows widgets to access mobile device logging +events such as call logs, messaging logs, and data logs. You can use the Logging +Service to create widgets that add, read, and delete logging +events. For example, you can create widgets that:

+
    +
  • Automatically delete the records of received calls older +than a specified number of days

  • +
  • Create unique records of calls based on criteria such as +call duration

  • +
  • Provide useful information to mobile device users such as +the number of MB of data sent and received for the day

  • +
+

Accessing the API and supported methods

+

To create a service +object for the Logging Service API, use Service.Logging to +identify the service provider and IDataSource to identify +the supported interface:

+ +
var so = device.getServiceObject("Service.Logging", "IDataSource");
+

The IDataSource interface provides the following +methods:

+
    +
  • Add()

    + +

    Use the Add() method to add an entry to the event +log; for example, to create new types of application-specific log entries.

    + +
  • +
  • GetList()

    + +

    Use the GetList() method to retrieve event details +such as phone number or call duration from the event log.

    + +
  • +
  • Delete()

    + +

    Use the Delete() method to delete an entry from +the event log.

    + +
  • +
  • RequestNotification()

    + +

    Use the RequestNotification() method to request +notification of updates to the event log.

    + +
  • +
  • Cancel()

    + +

    Use the Cancel() method to cancel an ongoing asynchronous +call. This method is valid for any asynchronous call made through the Logging +Service API.

    + +
  • +
+
+

Using the service in a widget

+

To access and manage logs using the Logging Service API:

+
    +
  1. Create a service +object for the API using device.getServiceObject().

    +
  2. +
  3. Define the +tasks you want to perform and choose the correct methods for them.

    +
  4. +
  5. Optionally, +define how you want the results filtered.

  6. +
  7. Define functions +to process the results.

  8. +
  9. Retrieve the +results.

  10. +
  11. Process the +results.

  12. +
+

For the complete source of a sample widget that demonstrates how to +use this service, see the +full example.

+
+
\ No newline at end of file