|
1 |
|
2 <!DOCTYPE html |
|
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
4 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="mobileconcept"/><meta name="DC.Title" content="Accessing device logs"/><meta name="DC.Relation" scheme="URI" content="GUID-E3D26890-581A-427F-8AFF-16081528A8B8"/><meta name="DC.Relation" scheme="URI" content="GUID-4DDE31C7-EC0D-4EEC-BC3A-A0B0351154F8"/><meta name="DC.Relation" scheme="URI" content="GUID-1EFD7043-E9B8-4B4E-9EA6-A20B3EECC14A"/><meta name="DC.Relation" scheme="URI" content="GUID-46EABDC1-37CB-412A-ACAD-1A1A9466BB68"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-CF55DBA3-2D4C-4FD0-8A06-862E6128F4E7"/><title>Accessing |
|
5 device logs </title><script type="text/javascript"> |
|
6 function initPage() {} |
|
7 </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-CF55DBA3-2D4C-4FD0-8A06-862E6128F4E7">Accessing |
|
8 device logs</h1><div> |
|
9 <p>The <a href="GUID-F003B7DD-E450-49AD-B447-C5132FE47D3C.html#GUID-F003B7DD-E450-49AD-B447-C5132FE47D3C">Logging Service |
|
10 API</a> allows <span>widgets</span> to access mobile device logging |
|
11 events such as call logs, messaging logs, and data logs. You can use the Logging |
|
12 Service to create <span>widgets</span> that add, read, and delete logging |
|
13 events. For example, you can create <span>widgets</span> that:</p> |
|
14 <ul> |
|
15 <li><p>Automatically delete the records of received calls older |
|
16 than a specified number of days</p></li> |
|
17 <li><p>Create unique records of calls based on criteria such as |
|
18 call duration</p></li> |
|
19 <li><p>Provide useful information to mobile device users such as |
|
20 the number of MB of data sent and received for the day</p></li> |
|
21 </ul> |
|
22 <div><h3>Accessing the API and supported methods</h3> |
|
23 <p>To create a <a href="GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080.html#GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080">service |
|
24 object</a> for the Logging Service API, use <code>Service.Logging</code> to |
|
25 identify the service provider and <code>IDataSource</code> to identify |
|
26 the supported interface:</p> |
|
27 |
|
28 <pre class="codeblock" id="GUID-A2F3BA97-7375-4A1A-82EB-B7D0CCFDBB63-GENIDd0e8208">var so = device.getServiceObject("Service.Logging", "IDataSource");</pre> |
|
29 <p>The <code>IDataSource</code> interface provides the following |
|
30 methods:</p> |
|
31 <ul> |
|
32 <li><p><a href="GUID-F146B956-77AE-41B5-BA17-20F48AF8DBA7.html#GUID-F146B956-77AE-41B5-BA17-20F48AF8DBA7"><code>Add()</code></a></p> |
|
33 |
|
34 <p>Use the <code>Add()</code> method to add an entry to the event |
|
35 log; for example, to create new types of application-specific log entries.</p> |
|
36 |
|
37 </li> |
|
38 <li><p><a href="GUID-7E53CD9F-E213-42E7-8569-02AEA1198E52.html#GUID-7E53CD9F-E213-42E7-8569-02AEA1198E52"><code>GetList()</code></a></p> |
|
39 |
|
40 <p>Use the <code>GetList()</code> method to retrieve event details |
|
41 such as phone number or call duration from the event log.</p> |
|
42 |
|
43 </li> |
|
44 <li><p><a href="GUID-0022AED9-7B79-4C96-B82E-8B1EDF455E1D.html#GUID-0022AED9-7B79-4C96-B82E-8B1EDF455E1D"><code>Delete()</code></a></p> |
|
45 |
|
46 <p>Use the <code>Delete()</code> method to delete an entry from |
|
47 the event log.</p> |
|
48 |
|
49 </li> |
|
50 <li><p><a href="GUID-894E87F7-7146-44DD-8CAF-60F7C446B0D8.html#GUID-894E87F7-7146-44DD-8CAF-60F7C446B0D8"><code>RequestNotification()</code></a></p> |
|
51 |
|
52 <p>Use the <code>RequestNotification()</code> method to request |
|
53 notification of updates to the event log.</p> |
|
54 |
|
55 </li> |
|
56 <li><p><a href="GUID-043C7578-485F-4186-830F-013223A156D1.html#GUID-043C7578-485F-4186-830F-013223A156D1"><code>Cancel()</code></a></p> |
|
57 |
|
58 <p>Use the <code>Cancel()</code> method to cancel an ongoing asynchronous |
|
59 call. This method is valid for any asynchronous call made through the Logging |
|
60 Service API.</p> |
|
61 |
|
62 </li> |
|
63 </ul> |
|
64 </div> |
|
65 <div><h3>Using the service in a widget</h3> |
|
66 <p>To access and manage logs using the Logging Service API:</p> |
|
67 <ol> |
|
68 <li id="GUID-09408614-B079-437A-BF7C-1580105906C1-GENIDd0e8310"><a name="GUID-09408614-B079-437A-BF7C-1580105906C1-GENIDd0e8310"><!----></a><p>Create a service |
|
69 object for the API using <a href="GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080.html#GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080"><code>device.getServiceObject()</code></a>.</p> |
|
70 </li> |
|
71 <li id="GUID-C7877560-C290-4E7D-980C-D65D50DC5B4A-GENIDd0e8319"><a name="GUID-C7877560-C290-4E7D-980C-D65D50DC5B4A-GENIDd0e8319"><!----></a><p>Define the |
|
72 tasks you want to perform and choose the correct methods for them.</p> |
|
73 </li> |
|
74 <li id="GUID-C4DFB650-8BAD-4947-AE25-74DFCD52229C-GENIDd0e8324"><a name="GUID-C4DFB650-8BAD-4947-AE25-74DFCD52229C-GENIDd0e8324"><!----></a><p>Optionally, |
|
75 define how you want the results filtered.</p></li> |
|
76 <li id="GUID-03590B36-FFCA-4E39-A781-92080EE16B34-GENIDd0e8328"><a name="GUID-03590B36-FFCA-4E39-A781-92080EE16B34-GENIDd0e8328"><!----></a><p>Define functions |
|
77 to process the results.</p></li> |
|
78 <li id="GUID-76B47850-874B-4F80-9440-DB7E2A2B9477-GENIDd0e8332"><a name="GUID-76B47850-874B-4F80-9440-DB7E2A2B9477-GENIDd0e8332"><!----></a><p>Retrieve the |
|
79 results.</p></li> |
|
80 <li id="GUID-759B4621-D6DE-47E3-A9EE-6DC6AA4BCB97"><a name="GUID-759B4621-D6DE-47E3-A9EE-6DC6AA4BCB97"><!----></a><p>Process the |
|
81 results.</p></li> |
|
82 </ol> |
|
83 <p>For the complete source of a sample widget that demonstrates how to |
|
84 use this service, see <a href="GUID-9C85B403-6CFC-4E17-A2B2-AD1AD2F7794D.html#GUID-9C85B403-6CFC-4E17-A2B2-AD1AD2F7794D">the |
|
85 full example</a>.</p> |
|
86 </div> |
|
87 </div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html> |