org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-A5853293-7B83-4CCE-9C29-B2B8F0CD8A18.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 26 May 2010 17:01:34 -0700
changeset 341 480716493610
parent 229 716254ccbcc0
permissions -rw-r--r--
Set content type for png files


<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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="JavaScript Contacts Service API"/><meta name="DC.Relation" scheme="URI" content="GUID-B8845FF1-D7F6-476A-8651-8B9C12D8789F"/><meta name="DC.Relation" scheme="URI" content="GUID-CABB28B8-D2B1-496B-BD7E-34FF496E60B4"/><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.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-A5853293-7B83-4CCE-9C29-B2B8F0CD8A18"/><title>JavaScript Contacts
Service API </title><script type="text/javascript">
      function initPage() {}
    </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-A5853293-7B83-4CCE-9C29-B2B8F0CD8A18"><span>JavaScript</span> Contacts
Service API</h1><div>
<p>The <a href="GUID-662F2E2E-9538-42E5-9B5A-5664F1C11A9E.html#GUID-662F2E2E-9538-42E5-9B5A-5664F1C11A9E">Contacts
Service</a> API is supported since <a href="GUID-1A3ECAC1-3F09-4602-A1CD-82164040A664.html#GUID-1A3ECAC1-3F09-4602-A1CD-82164040A664">WRT 1.1</a>.</p>
<p>The Contacts Service API allows <span>widgets</span> to access and manage
information about contacts. This information can reside in one or more contacts
databases stored on a device or in the SIM card database. The API is integrated
into <span>WRT</span> through the <a href="GUID-571AF37F-1E95-462A-92D2-FEA2E62F1559.html#GUID-571AF37F-1E95-462A-92D2-FEA2E62F1559"><code>device</code></a> object.</p>
<p>For an overview of the service and the API, see section <a href="GUID-662F2E2E-9538-42E5-9B5A-5664F1C11A9E.html#GUID-662F2E2E-9538-42E5-9B5A-5664F1C11A9E">Accessing and managing information about contacts</a>.</p>
<div><h3>Using the Contacts Service API</h3>
<p>To use the Contacts Service API, your <span>widget</span> must first create <span>a service object for it
using the <a href="GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080.html#GUID-04095E9A-50E7-4E5F-BD6F-71DA281A0080"><code>device.getServiceObject()</code></a> method</span>.
Use <code>Service.Contact</code> to identify the service provider
and <code>IDataSource</code> to identify the supported interface:</p>
<pre class="codeblock" id="GUID-7B1C567A-A31A-4AED-8F7B-9DFC175068AD">var so = device.getServiceObject("Service.Contact", "IDataSource");</pre>

<p>This service object can then be used to access the services provided
by the API:</p>
<ul>
<li><p><a href="GUID-37C9E5F0-BEA9-4E0B-A40D-B953B3551007.html#GUID-37C9E5F0-BEA9-4E0B-A40D-B953B3551007"><code>IDataSource.GetList()</code></a></p>
</li>
<li><p><a href="GUID-20D66938-A870-43D7-9515-AC7E22AEDC14.html#GUID-20D66938-A870-43D7-9515-AC7E22AEDC14"><code>IDataSource.Add()</code></a></p>
</li>
<li><p><a href="GUID-E6FAAB7C-EE2D-4464-9D0F-B1D89E26ABCF.html#GUID-E6FAAB7C-EE2D-4464-9D0F-B1D89E26ABCF"><code>IDataSource.Delete()</code></a></p>
</li>
<li><p><a href="GUID-154DA5F4-32F6-42E2-A107-A7C72F6F9DE5.html#GUID-154DA5F4-32F6-42E2-A107-A7C72F6F9DE5"><code>IDataSource.Import()</code></a></p>
</li>
<li><p><a href="GUID-CA7C3A7B-6733-47E0-9C6F-FBFB0993F034.html#GUID-CA7C3A7B-6733-47E0-9C6F-FBFB0993F034"><code>IDataSource.Export()</code></a></p>
</li>
<li><p><a href="GUID-F2CE0F94-324C-4D45-BD37-DA55F9DAC077.html#GUID-F2CE0F94-324C-4D45-BD37-DA55F9DAC077"><code>IDataSource.Organise()</code></a></p>
</li>
<li><p><a href="GUID-231C11D4-82B3-4202-8E86-DE8A3556C9DE.html#GUID-231C11D4-82B3-4202-8E86-DE8A3556C9DE"><code>IDataSource.Cancel()</code></a></p>
</li>
</ul>
</div>
<div><h3>Emulator support</h3>
<p>The S60 5th Edition SDK emulator provides full support for the Contacts
Service API. However, SIM-specific operations can only be run on a device.</p>
</div>
</div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html>