|
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="ILocation.Trace()"/><meta name="DC.Relation" scheme="URI" content="GUID-DBEE8177-7246-4FEE-A0F1-D6AEEA6EA206"/><meta name="DC.Relation" scheme="URI" content="GUID-150E440F-56E4-4249-8739-A5A7A2050600"/><meta name="DC.Relation" scheme="URI" content="GUID-7C69DDA4-16F1-4A8F-BDB2-4CB0015B4E81"/><meta name="DC.Relation" scheme="URI" content="GUID-65AAF569-D347-462B-B59A-9D7CA184AB9C"/><meta name="DC.Relation" scheme="URI" content="GUID-53CE4DE6-F065-4339-8C18-5C30A9540053"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-7A0190CB-545E-48D2-BAF0-D28E03CDFCA5"/><title>ILocation.Trace() </title><script type="text/javascript"> |
|
5 function initPage() {} |
|
6 </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-7A0190CB-545E-48D2-BAF0-D28E03CDFCA5"><span>ILocation.</span>Trace()</h1><div> |
|
7 <p><strong>Description:</strong></p> |
|
8 <p>The <code>Trace</code> method retrieves periodic updates about |
|
9 the current location of the device based on a predefined update interval.</p> |
|
10 <p>This is an asynchronous method.</p> |
|
11 <p><strong>Syntax:</strong></p> |
|
12 <pre class="codeblock" id="GUID-676491ED-F5F1-4B9C-887C-EB50FE523F99">result = so.ILocation.Trace(criteria, callback);</pre> |
|
13 |
|
14 <p><strong>Arguments:</strong></p> |
|
15 <ul> |
|
16 <li><p><code>criteria</code>:</p> |
|
17 |
|
18 <p>This is an object that specifies what type of device location information |
|
19 is returned and how. For more information about the object properties and |
|
20 how to define them, see section <a href="GUID-4541E532-CC1A-4115-8467-7FA1C4378307.html#GUID-4541E532-CC1A-4115-8467-7FA1C4378307">Criteria for retrieving location information</a>.</p> |
|
21 |
|
22 </li> |
|
23 <li><p><code>callback</code>:</p> |
|
24 |
|
25 <p>The <code>callback</code> argument is the name of the method |
|
26 that is executed when <code>Trace</code> has results or status information |
|
27 to return. You must define this method separately. Follow the instructions |
|
28 in section <a href="GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608.html#GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608">Defining the callback handler for an asynchronous method</a> to |
|
29 define the <code>callback</code> method.</p> |
|
30 |
|
31 </li> |
|
32 </ul> |
|
33 <p><strong>Return value:</strong></p> |
|
34 <p>The <code>Trace</code> method returns an object that contains |
|
35 the initial return value for the asynchronous call it started (see the following |
|
36 table). The actual location information is returned by the <a href="GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608.html#GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608"><code>callback</code></a> method in the <code>ReturnValue</code> property of its result object. |
|
37 The returned information is described in section <a href="GUID-A6C9AF19-6694-478B-A9FE-7898A2091C4B.html#GUID-A6C9AF19-6694-478B-A9FE-7898A2091C4B">Returned location information</a>.</p> |
|
38 <div class="tablenoborder"><a name="GUID-F2F7057D-0C4F-4837-9567-ACA408CEA101"><!----></a><table cellpadding="4" cellspacing="0" summary="" id="GUID-F2F7057D-0C4F-4837-9567-ACA408CEA101" frame="border" border="1" rules="all"><caption><strong>Table: </strong>Return value |
|
39 properties for Trace</caption> |
|
40 |
|
41 <thead align="left"> |
|
42 <tr class="title "><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e48640"> |
|
43 <p>Property</p> |
|
44 </th><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e48645"> |
|
45 <p>Description</p> |
|
46 </th><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e48650"> |
|
47 <p>Value</p> |
|
48 </th></tr> |
|
49 </thead> |
|
50 <tbody> |
|
51 <tr class=""> |
|
52 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48640 "> |
|
53 <p><code>result.TransactionID</code></p> |
|
54 </td> |
|
55 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48645 "> |
|
56 <p>This is a number used as an identification to match transactions started |
|
57 with the <code>Trace</code> call to one or more calls it generates |
|
58 to <code>callback</code>.</p> |
|
59 </td> |
|
60 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48650 "> </td> |
|
61 </tr> |
|
62 <tr class="bg "> |
|
63 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48640 "> |
|
64 <p><code>result.ErrorCode</code></p> |
|
65 </td> |
|
66 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48645 "> |
|
67 <p>This is a number that specifies a predefined error code.</p> |
|
68 </td> |
|
69 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48650 "> |
|
70 <p>See <a href="GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4.html#GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4">Service API error codes</a>.</p> |
|
71 </td> |
|
72 </tr> |
|
73 <tr class=""> |
|
74 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48640 "> |
|
75 <p><code>result.ErrorMessage</code></p> |
|
76 </td> |
|
77 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48645 "> |
|
78 <p>This is a text string that describes the error.</p> |
|
79 </td> |
|
80 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e48650 "> |
|
81 <p>See <a href="GUID-DEA4164E-5F03-4B57-97B9-4C6238481F89.html#GUID-DEA4164E-5F03-4B57-97B9-4C6238481F89">Location Service API error messages</a>.</p> |
|
82 </td> |
|
83 </tr> |
|
84 </tbody> |
|
85 </table></div> |
|
86 <p><strong>Remarks:</strong></p> |
|
87 <ul> |
|
88 <li><p><code>Trace</code> retrieves location updates until |
|
89 cancelled with <a href="GUID-7A466B60-88DD-4A3A-B64C-E7300D42DA56.html#GUID-7A466B60-88DD-4A3A-B64C-E7300D42DA56"><code>CancelNotification</code></a>. |
|
90 You can therefore have only one <code>Trace</code> call (one instance) |
|
91 pending or in use at any given time.</p></li> |
|
92 <li><p>The availability of specific location information depends |
|
93 on the underlying GPS technology. Other factors, such as the number of satellites |
|
94 available for a location fix, also affect what information can be returned. |
|
95 You can change the positioning system used by an S60 device from the <strong>Settings |
|
96 > General > Positioning > Positioning methods</strong> menu.</p></li> |
|
97 <li><p>It takes time to retrieve the initial position fix. Subsequent |
|
98 requests are faster.</p></li> |
|
99 </ul> |
|
100 <p><strong>Example code:</strong></p> |
|
101 <p/> |
|
102 <p>For the complete source of a sample widget |
|
103 that demonstrates how to use this Service API, see <a href="GUID-620340F8-F844-445E-80AA-71C757320B7E.html#GUID-620340F8-F844-445E-80AA-71C757320B7E">the |
|
104 full example</a>.</p> |
|
105 |
|
106 |
|
107 </div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html> |