</ul></li>
<li>Speed dials
<ul>
- <li><a class="opensection" href="#sd_init">Initializing the Speed Dial Feature</a>
- <p>Initialize the speed dial feature for use.</p></li>
<li><a class="opensection" href="#sd_create">Creating a Speed Dial</a>
<p>Create a new speed dial.</p></li>
<li><a class="opensection" href="#sd_set">Setting Speed Dial Properties</a>
</ul></li>
<li>Phone logs
<ul>
- <li><a class="opensection" href="#pl_init">Initializing the Phone Log</a>
- <p>Initialize the phone log for use.</p></li>
<li><a class="opensection" href="#pl_create">Creating a Log</a>
<p>Create a new log.</p></li>
<li><a class="opensection" href="#pl_set">Setting Log Properties</a>
<p>You can get the associated contacts of a person by query. In this example, you get the associated contact records.</p>
<pre class="prettyprint">static bool _get_associated_contacts(contacts_record_h record, contacts_list_h *associated_contacts)
{
- int error_code;
+ int error_code = CONTACTS_ERROR_NONE;
int person_id;
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
error_code = contacts_record_get_int(record, _contacts_person.id, &person_id);
- error_code = CONTACTS_ERROR_NONE;
error_code += contacts_query_create(_contacts_contact._uri, &query);
error_code += contacts_filter_create(_contacts_contact._uri, &filter);
error_code += contacts_filter_add_int(filter, _contacts_contact.person_id, CONTACTS_MATCH_EQUAL, person_id);
error_code = contacts_group_add_contact(group_id, contact_id);
</pre></li>
<li>To remove a contact from a group, call <span style="font-family: Courier New,Courier,monospace">contacts_group_remove_contact()</span>.
-<pre class="prettyprint">int contact_id = ... // Acquire contact ID
-int group_id = ... // Acquire group ID
-
+<pre class="prettyprint">
error_code = contacts_group_remove_contact(group_id, contact_id);
</pre></li>
<li>To get a list of persons assigned to a specific group:
<ol><li>Get the records of type <span style="font-family: Courier New,Courier,monospace">_contacts_person_group_assigned</span>:
-<pre class="prettyprint">int group_id = ... // Acquire group ID
-
+<pre class="prettyprint">
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
contacts_list_h list = NULL;
}</pre>
</div>
</li>
-<li>
- <div class="devicespec-tit">
- <h2 id="sd_init" name="sd_init" class="items-tit-h2">Initializing the Speed Dial Feature</h2>
-<span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
- </div>
- <div class="devicespec-con">
-<p>To start with the Contact Service:</p>
-<ol>
-<li>
-<p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__MODULE.html">Contacts</a> API, include the <span style="font-family: Courier New,Courier,monospace"><contacts.h></span> header file in your application:</p>
-<pre class="prettyprint">
-#include <contacts.h>
-</pre></li>
-<li>Most API functions return error codes, therefore define the <span style="font-family: Courier New,Courier,monospace">int</span> type at the beginning of your code. The <span style="font-family: Courier New,Courier,monospace">int</span> type is used to store error codes. Each time when a function returns error codes, verify the result of the operation.</li>
-<li>Call the <span style="font-family: Courier New,Courier,monospace">contacts_connect()</span> function, which connects your application to the Contact Service. Without this function, you cannot access the Contacts database.
-<pre class="prettyprint">
-int error_code;
-error_code = contacts_connect();
-if (error_code != CONTACTS_ERROR_NONE)
- dlog_print(DLOG_ERROR, LOG_TAG, "contacts connect failed: %x", error_code);
-</pre>
-</li>
-<li>When the Contacts APIs are not needed anymore, disconnect from the service using the <span style="font-family: Courier New,Courier,monospace">contacts_disconnect()</span> function:
-<pre class="prettyprint">
-error_code = contacts_disconnect();
-</pre>
-</li>
-</ol>
- </div>
- </li>
<li>
<div class="devicespec-tit">
<h2 id="sd_create" name="sd_create" class="items-tit-h2">Creating a Speed Dial</h2>
</pre>
</div>
</li>
-<li>
- <div class="devicespec-tit">
- <h2 id="pl_init" name="pl_init" class="items-tit-h2">Initializing the Phone Log</h2>
-<span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
- </div>
- <div class="devicespec-con">
-<p>To start with the Contact Service:</p>
-<ol>
-<li>
-<p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__MODULE.html">Contacts</a> API, include the <span style="font-family: Courier New,Courier,monospace"><contacts.h></span> header file in your application:</p>
-<pre class="prettyprint">
-#include <contacts.h>
-</pre></li>
-<li>Most of the API functions return error codes, therefore define at the beginning of your code the <span style="font-family: Courier New,Courier,monospace">int</span> type, which is used to store error codes. Each time when a function returns error codes, verify the result of the operation.</li>
-<li>Call the <span style="font-family: Courier New,Courier,monospace">contacts_connect()</span> function, which connects your application with the Contact Service. Without this function, you cannot get access to the Contacts database.
-<pre class="prettyprint">
-int error_code;
-error_code = contacts_connect();
-if (error_code != CONTACTS_ERROR_NONE)
- dlog_print(DLOG_ERROR, LOG_TAG, "contacts connect failed: %x", error_code);
-</pre>
-</li>
-<li>When the Contacts APIs are not needed anymore, disconnect from the service using the <span style="font-family: Courier New,Courier,monospace">contacts_disconnect()</span> function:
-<pre class="prettyprint">
-error_code = contacts_disconnect();
-if (error_code != CONTACTS_ERROR_NONE)
- dlog_print(DLOG_ERROR, LOG_TAG, "contacts connect failed: %x", error_code);
-</pre>
-</li>
-</ol>
-
- </div>
- </li>
<li>
<div class="devicespec-tit">
<h2 id="pl_create" name="pl_create" class="items-tit-h2">Creating a Log</h2>
</script>
</body>
-</html>
\ No newline at end of file
+</html>