some updates: CLI, contact, email_tutorial_n.htm
authorDonghyun Lee <dh0922.lee@samsung.com>
Thu, 15 Oct 2015 05:19:20 +0000 (14:19 +0900)
committerDonghyun Lee <dh0922.lee@samsung.com>
Thu, 15 Oct 2015 05:19:23 +0000 (14:19 +0900)
org.tizen.devtools/html/native_tools/command_line_interface_n.htm
org.tizen.guides/html/images/loc_priv_setting.png [deleted file]
org.tizen.guides/html/native/social/contact_n.htm
org.tizen.guides/html/web/tizen/ime/ime_w.htm
org.tizen.tutorials/html/native/messaging/email_tutorial_n.htm
org.tizen.tutorials/html/native/messaging/sms_mms_tutorial_n.htm
org.tizen.tutorials/html/native/social/contact_tutorial_n.htm

index 0d35b51..4cd426c 100644 (file)
@@ -483,11 +483,11 @@ $ tizen package --type tpk --sign myprofile2 -- /home/workspace/basic/Debug/org.
 </pre>
 <ul>
 <li><span style="font-family: Courier New,Courier,monospace;">-t, --target</span>:
-<p>Specifies the name of the target device such as an emulator instance, a connected hardware, which the Tizen package will be installed.</p></li>
+<p>Specifies the name of the target device, such as an emulator instance or a connected hardware, where the Tizen package is installed.</p></li>
 <li><span style="font-family: Courier New,Courier,monospace;">-n, --name</span>:
-<p>Specifies the Tizen package file name.</p></li>
+<p>Specifies the name of the Tizen package file.</p></li>
 <li><span style="font-family: Courier New,Courier,monospace;">--</span>:
-<p>Specifies the directory path where the package is saved.</p></li>
+<p>Specifies the directory path where the Tizen package is saved.</p></li>
 </ul></td>
         <td>Installs a Tizen application on the target.
         </td>
diff --git a/org.tizen.guides/html/images/loc_priv_setting.png b/org.tizen.guides/html/images/loc_priv_setting.png
deleted file mode 100644 (file)
index 27395e5..0000000
Binary files a/org.tizen.guides/html/images/loc_priv_setting.png and /dev/null differ
index 61d826e..4eaeb66 100644 (file)
@@ -599,6 +599,22 @@ contacts_record_add_child_record(contact, _contacts_contact.address, address);
 contacts_db_insert_record(contact, &amp;contact_id);
 contacts_record_destroy(contact, true);</pre>
 
+<table class="note">
+   <tbody>
+    <tr>
+     <th class="note">Note</th>
+    </tr>
+    <tr>
+     <td class="note">For an application to insert private images in contacts, the following conditions apply:
+        <ul><li>The application must have the <span style="font-family: Courier New,Courier,monospace">http://tizen.org/privilege/contact.write</span> privilege to use the APIs, such as <span style="font-family: Courier New,Courier,monospace">contacts_db_insert_record()</span>.</li>
+        <li>The application&#39;s private directory and files must have the <span style="font-family: Courier New,Courier,monospace">read</span> permission of others, such as <span style="font-family: Courier New,Courier,monospace">644</span>. SMACK protects the <span style="font-family: Courier New,Courier,monospace">read</span> permission from the other applications.</li>
+        <li>The application can erase the image after destroying the contact record (using the <span style="font-family: Courier New,Courier,monospace">contacts_record_destroy()</span> function).</li></ul>
+     </td>
+    </tr>
+   </tbody>
+</table>
+
+
 <h3>Record ID Property</h3>
 
 <p>An ID is a unique number for identifying records. Therefore, if you know the ID of a record, you can directly handle the record. The ID is read-only property, which is available after the record has been inserted into the database. The following example gets a contact record with an ID:</p>
@@ -713,9 +729,6 @@ contacts_vcard_make_from_contact(contact, &amp;vcard_stream);
 free(vcard_stream);
 contacts_record_destroy(contact, true);</pre>
          
-
-   
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
 </div></div></div>
index 225e24f..d844efa 100644 (file)
@@ -196,7 +196,7 @@ Keycode:
  
   <table> 
    <caption>
-     Table:Handler events 
+     Table: Handler events 
    </caption> 
    <tbody> 
     <tr> 
index e4ca1b9..6454b43 100644 (file)
@@ -24,7 +24,7 @@
                <p class="toc-title">Content</p>
                <ul class="toc">
                        <li><a href="#init">Initializing the Email Service</a></li>
-                       <li><a href="#creatingmail">Creating and Sending Email</a></li>
+                       <li><a href="#creatingmail">Creating and Sending Email Messages</a></li>
                </ul>       
         <p class="toc-title">Related Info</p>
         <ul class="toc">
         <ul>
             <li><a href="#init">Initializing the Email Service</a>
                        <p>Initialize the email service for use.</p></li>
-                       <li><a href="#creatingmail">Creating and Sending Email</a>
+                       <li><a href="#creatingmail">Creating and Sending Email Messages</a>
                        <p>Create and send a message after adding attachments and recipients.</p></li>
         </ul>
 
 
  <h2 id="init" name="init">Initializing the Email Service</h2>
 
-<p>To initialize the email service:</p>
+<p>To initialize the email service for use:</p>
 <ol><li><p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MESSAGING__EMAIL__MODULE.html">Email</a> API, include the <span style="font-family: Courier New,Courier,monospace;">&lt;email.h&gt;</span> header file in your application:</p>
 <pre class="prettyprint">
 #include &lt;email.h&gt;
-</pre></li>
+</pre>
+<p>To ensure that an Email function has been executed properly, make sure that the return value is equal to <span style="font-family: Courier New,Courier,monospace;">EMAILS_ERROR_NONE</span>.</p></li>
 <li>                   
 <p>Set up at least 1 email account on your device before sending an email.</p></li></ol>
 
 <p>The email service does not need any initialization or connection opening before the API usage.</p>
 
- <h2 id="creatingmail" name="creatingmail">Creating and Sending Email</h2>
+ <h2 id="creatingmail" name="creatingmail">Creating and Sending Email Messages</h2>
 
 <p>To create and send email messages:</p>
 
 <ol><li>Create an email message.
-<p>To create an email message and receive its handle, use the <span style="font-family: Courier New,Courier,monospace;">email_create_message()</span> function. The function return code informs about success or failure.</p>
-<pre class="prettyprint">email_h msg;
+<p>To create an email message and receive its handle, use the <span style="font-family: Courier New,Courier,monospace;">email_create_message()</span> function.</p>
+<pre class="prettyprint">
+email_h msg;
 int error_code = EMAILS_ERROR_NONE;
 error_code = email_create_message(&amp;msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to create email message\n&quot;);
-}</pre>
-<p>One of the possible error codes that is not related to the Email module itself is <span style="font-family: Courier New,Courier,monospace;">EMAIL_ERROR_ACCOUNT_NOT_FOUND</span>. This error occurs if no email account has been configured on a device.</p></li>
+}
+</pre>
+<p>The function return code defines whether the message creation succeeded. The <span style="font-family: Courier New,Courier,monospace;">EMAIL_ERROR_ACCOUNT_NOT_FOUND</span> error is not related to the email service as such; it occurs if no email account has been configured on the device.</p></li>
 
-<li>Add recipients and attachments.
-<p>Email recipients can be added to the email message one by one. There is no possibility to add lists of recipients in one function call. Each address has to be given as a character string and the address type (TO, CC, BCC) has to be declared.</p>
-<pre class="prettyprint">error_code = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, &quot;example@mail.com&quot;);
+<li>Manage recipients and attachments:
+<ol>
+<li>
+<p>Add recipients to the email message one by one. You cannot add lists of recipients in one function call. Each address must be given as a character string with the address type (TO, CC, BCC) declared.</p>
+<pre class="prettyprint">
+error_code = email_add_recipient(msg, EMAIL_RECIPIENT_TYPE_TO, &quot;example@mail.com&quot;);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to add recipient\n&quot;);
-}</pre>
-<p>To add an attachment to the email message, you need a full path to the attachment file. Currently, files with size up to 10 MB are supported.</p>
-    <pre class="prettyprint">error_code = email_add_attach(msg, &quot;/full/path/to/attachment&quot;);
+}
+</pre></li>
+<li><p>Add an attachment to the email message with a full path to the attachment file. Currently, files with size up to 10 MB are supported.</p>
+<pre class="prettyprint">
+error_code = email_add_attach(msg, &quot;/full/path/to/attachment&quot;);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to add attachment\n&quot;);
-}</pre></li>
+}
+</pre></li>
 
 <li>Remove recipients or attachments.
-<p>You can remove added recipients and attachments. In both cases, all recipients or attachments are removed at once. It is not possible to remove one selected item. As all functions from the Email API, the <span style="font-family: Courier New,Courier,monospace;">email_remove_all_attachments()</span> and <span style="font-family: Courier New,Courier,monospace;">email_remove_all_recipients()</span> functions inform about success or failure by the returned error code.</p>
-<pre class="prettyprint">error_code = email_remove_all_recipients(msg);
+<p>In both cases, all recipients or attachments are removed at once. It is not possible to remove one selected item.</p>
+<pre class="prettyprint">
+error_code = email_remove_all_recipients(msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to add remove recipients\n&quot;);
@@ -104,19 +114,23 @@ error_code = email_remove_all_attachments (msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to remove attachments\n&quot;);
-}</pre></li>
-
+}
+</pre></li>
+</ol>
+</li>
 <li>Save the email before sending it:
-<pre class="prettyprint">error_code = email_save_message(msg);
+<pre class="prettyprint">
+error_code = email_save_message(msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to save email\n&quot;);
 }
 </pre></li>
 
-<li>Define the email sending status callback.
-<p>Email sending is an asynchronous operation, and thus the sending status cannot be checked directly in the return code from the <span style="font-family: Courier New,Courier,monospace;">email_send_message()</span> function. To receive notifications about sending success or failure, a callback function must be defined.</p>
-<pre class="prettyprint">static void 
+<li>Define and register the email sending status callback.
+<p>Email sending is an asynchronous operation, and thus the sending status cannot be checked directly in the return code from the <span style="font-family: Courier New,Courier,monospace;">email_send_message()</span> function. To receive notifications about sending success or failure, use a callback function.</p>
+<pre class="prettyprint">
+static void 
 email_send_status(email_h email, email_sending_e result, void *user_data) 
 {
 &nbsp;&nbsp;&nbsp;if (result == EMAIL_SENDING_FAILED) 
@@ -129,23 +143,28 @@ email_send_status(email_h email, email_sending_e result, void *user_data)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Sending was successful
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Email sending finished with success\n&quot;);
 &nbsp;&nbsp;&nbsp;}
-}</pre></li>
+}
 
-<li>Send the email.
-<p>If the email message object is ready and the sending status callback is defined, the message can be sent.</p>
-<pre class="prettyprint">error_code = email_set_message_sent_cb(msg, email_send_status, NULL);
+error_code = email_set_message_sent_cb(msg, email_send_status, NULL);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to set sending status callback\n&quot;);
 }
+</pre></li>
 
+<li>Send the email:
+<pre class="prettyprint">
 error_code = email_send_message(msg, false);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;&quot;);
-}</pre>
-<p>When the message is sent or if sending was canceled and the message is no longer needed, delete it using the <span style="font-family: Courier New,Courier,monospace;">email_destroy_message()</span> function. The callback registered for the specified message must also be unset using the <span style="font-family: Courier New,Courier,monospace;">email_unset_message_sent_cb()</span> callback function.</p>
-<pre class="prettyprint">error_code = email_unset_message_sent_cb(msg);
+}
+</pre>
+</li>
+<li>
+<p>When the message is sent or if sending is canceled and the message no longer needed, delete it using the <span style="font-family: Courier New,Courier,monospace;">email_destroy_message()</span> function. The registered email sending status callback must also be unset using the <span style="font-family: Courier New,Courier,monospace;">email_unset_message_sent_cb()</span> function.</p>
+<pre class="prettyprint">
+error_code = email_unset_message_sent_cb(msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to unset status callback\n&quot;);
@@ -155,7 +174,8 @@ error_code = email_destroy_message(msg);
 if (error_code != EMAILS_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;Failed to delete email message\n&quot;);
-}</pre></li></ol>
+}
+</pre></li></ol>
                
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
index 6da67e9..5cc5490 100644 (file)
  
  <h2 id="init" name="init">Initializing the Messages Service</h2>
 
-<p>To initialize the Messages service:</p>
+<p>To initialize the Messages service for use:</p>
 
 <ol><li><p>To use the functions and data types of the Messages API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MESSAGING__MESSAGES__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__MESSAGING__MESSAGES__MODULE.html">wearable</a> applications), include the <span style="font-family: Courier New,Courier,monospace">&lt;messages.h&gt;</span> header file in your application:</p>
 <pre class="prettyprint">
 #include &lt;messages.h&gt;
 </pre></li>
 <li><p>The Messages service works like a client-service architecture. In this architecture, a Tizen application is the client side and has to connect to the service before using the Messages API.</p>
-<p>Establish a connection using the <span style="font-family: Courier New,Courier,monospace;">messages_open_service(messages_service_h *service)</span> function.</p>
+<p>Establish a connection using the <span style="font-family: Courier New,Courier,monospace;">messages_open_service()</span> function:</p>
 
-<pre class="prettyprint">static messages_service_h service_handle = NULL;
+<pre class="prettyprint">
+static messages_service_h service_handle = NULL;
 int error_code;
 
 error_code = messages_open_service(&amp;service_handle);
@@ -72,12 +73,15 @@ error_code = messages_open_service(&amp;service_handle);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;// Error handling
-}</pre></li>
+}
+</pre></li>
 
 <li><p>When a connection with the Messages service is no longer needed (or the application is exiting), call the <span style="font-family: Courier New,Courier,monospace;">messages_close_service()</span> function for proper connection closing:</p>
 
-<pre class="prettyprint">messages_close_service(service_handle);
-service_handle = NULL;</pre></li></ol>
+<pre class="prettyprint">
+messages_close_service(service_handle);
+service_handle = NULL;
+</pre></li></ol>
 
  <h2 id="fetching" name="fetching">Fetching Messages from a Specified Message Box</h2>
 
@@ -85,10 +89,11 @@ service_handle = NULL;</pre></li></ol>
 
 <p>To fetch messages:</p>
 
-<ol><li>Define the message searching callback function.
+<ol><li>Define the message search callback function.
 <ol type="a">
-<li><p>Within the callback, to print the message content (or to show it to the user in any other way), extract its text, address, and type as in the following example:</p>
-<pre class="prettyprint">char *message = NULL, *address = NULL;
+<li><p>Within the callback, to print the message content (or to show it to the user in any other way), extract the message text, address, and type:</p>
+<pre class="prettyprint">
+char *message = NULL, *address = NULL;
 messages_recipient_type_e rtype;
 int error_code = MESSAGES_ERROR_NONE;
 
@@ -105,10 +110,12 @@ if (error_code != MESSAGES_ERROR_NONE)
 }
 
 messages_message_type_e mtype = MESSAGES_TYPE_UNKNOWN;
-messages_get_message_type(msg, &amp;mtype);</pre></li>
+messages_get_message_type(msg, &amp;mtype);
+</pre></li>
 
 <li><p>For MMS messages, the subject and attachments attributes exist and can be extracted from the found message:</p>
-<pre class="prettyprint">if (MESSAGES_TYPE_MMS == mtype) 
+<pre class="prettyprint">
+if (MESSAGES_TYPE_MMS == mtype) 
 {
 &nbsp;&nbsp;&nbsp;char *subject = NULL;
 &nbsp;&nbsp;&nbsp;error_code = messages_mms_get_subject(msg, &amp;subject);
@@ -118,26 +125,29 @@ messages_get_message_type(msg, &amp;mtype);</pre></li>
 &nbsp;&nbsp;&nbsp;}
 &nbsp;&nbsp;&nbsp;int atcount = 0;
 &nbsp;&nbsp;&nbsp;messages_mms_get_attachment_count(msg, &amp;atcount);
-}</pre></li>
+}
+</pre></li>
 
-<li><p>The memory allocated for the message given to the callback function and for all string variables extracted from the message have to be explicitly released before leaving their visibility scope:</p>
-<pre class="prettyprint">free(subject);
+<li><p>The memory allocated for the message given to the callback function and for all string variables extracted from the message has to be explicitly released before leaving the applicable visibility scope:</p>
+<pre class="prettyprint">
+free(subject);
 free(message);
-free(address);</pre></li></ol></li>
+free(address);
+</pre></li></ol></li>
 
 
-<li>Call the search function.
-<p>With a connection opened and callback prepared, the <span style="font-family: Courier New,Courier,monospace;">messages_foreach_message()</span> function can be called to retrieve all existing messages stored in different mailboxes. The function arguments allow to select only a subset of all available messages based on:</p>
+<li>Perform the search.
+<p>Call the <span style="font-family: Courier New,Courier,monospace;">messages_foreach_message()</span> function to retrieve all existing messages stored in different mailboxes. With the function parameters, you can limit the search results to a subset of all available messages based on:</p>
 <ul><li>Message box type (inbox, outbox, sent items, drafts, or all of them)</li>
-<li>Message type (such as SMS, MMS)</li>
-<li>Keyword (for searching based on text and subject)</li>
+<li>Message type (such as SMS or MMS)</li>
+<li>Keyword (for search based on text and subject)</li>
 <li>Address (message recipient address)</li></ul>
 
-<p>The following example shows a simple search for all SMS messages in all message boxes with a callback function named <span style="font-family: Courier New,Courier,monospace;">message_search_callback</span>.</p>
-<pre class="prettyprint">int error_code;
+<p>The following example shows a simple search for all SMS messages in all message boxes with a callback function named <span style="font-family: Courier New,Courier,monospace;">message_search_callback()</span>.</p>
+<pre class="prettyprint">
+int error_code;
 error_code = messages_open_service(&amp;service_handle);
 if (error_code != MESSAGES_ERROR_NONE) 
-
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to open connection&quot;);
 }
@@ -150,16 +160,17 @@ if (error_code != MESSAGES_ERROR_NONE)
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Messages searching failed&quot;);
 }
 
-messages_close_service(service_handle);</pre></li></ol>
+messages_close_service(service_handle);
+</pre></li></ol>
 
  <h2 id="sending" name="sending">Sending SMS or MMS Messages</h2>
 
 <p>The Messaging API supports SMS (Short Message Service) messages and MMS (Multimedia Message Service) messages with attachments (image or video files).</p>
 <p>To send a message:</p>
 <ol><li>Create a message.
-<p>Before sending a message, open a connection to the messaging service.</p>
 <p>To create an SMS or an MMS message, use the <span style="font-family: Courier New,Courier,monospace;">messages_create_message()</span> function. Specify the message type (<span style="font-family: Courier New,Courier,monospace;">MESSAGES_TYPE_SMS</span> or <span style="font-family: Courier New,Courier,monospace;">MESSAGES_TYPE_MMS</span>) when creating the message. The following example creates an SMS message.</p>
-<pre class="prettyprint">int error_code;
+<pre class="prettyprint">
+int error_code;
 messages_message_h msg_hndl = NULL;
 
 // Create an SMS message handle
@@ -167,10 +178,12 @@ error_code = messages_create_message(MESSAGES_TYPE_SMS, &amp;msg_hndl);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to create message&quot;);
-}</pre></li>
+}
+</pre></li>
 <li>Define the recipients and message body.
-<p>Functions for setting the recipient address and the message body (the message text) are the same for SMS and MMS, but in this case the message type specification is not needed.</p>
-<pre class="prettyprint">error_code = messages_add_address(msg_hndl, &quot;123456789&quot;, MESSAGES_RECIPIENT_TO);
+<p>Functions for setting the recipient address and the message body (the message text) are the same for SMS and MMS.</p>
+<pre class="prettyprint">
+error_code = messages_add_address(msg_hndl, &quot;123456789&quot;, MESSAGES_RECIPIENT_TO);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to add recipient address&quot;);
@@ -180,26 +193,33 @@ error_code = messages_set_text(msg_hndl, __PRETTY_FUNCTION__);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to set message text&quot;);
-}</pre></li>
+}
+</pre></li>
 
-<li>Set a subject and add an attachment (note that sending MMS is not supported on the Emulator).
-<ul><li><p>Set a message subject to a MMS message:</p>
-<pre class="prettyprint">error_code = messages_mms_set_subject(msg_hndl, &quot;MMS test&quot;);
+<li>Set a subject and add an attachment for an MMS message (note that MMS sending is not supported on the Emulator).
+<ul><li><p>Set a message subject:</p>
+<pre class="prettyprint">
+error_code = messages_mms_set_subject(msg_hndl, &quot;MMS test&quot;);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to set MMS subject&quot;);
-}</pre></li>
-<li><p>Add attachments to the MMS message with their absolute path in the device file system. When adding the attachment, give the attachment type. Possible attachment types are image, audio, and video.</p>
-<pre class="prettyprint">error_code = messages_mms_add_attachment(g_message, MESSAGES_MEDIA_IMAGE, &quot;/path/to/image/file&quot;);
+}
+</pre></li>
+<li><p>Add attachments with their absolute path in the device file system. When adding the attachment, give the attachment type. Possible attachment types are image, audio, and video.</p>
+<pre class="prettyprint">
+error_code = messages_mms_add_attachment(g_message, MESSAGES_MEDIA_IMAGE, 
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;/path/to/image/file&quot;);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to add attachment to MMS&quot;);
-}</pre></li></ul></li>
+}
+</pre></li></ul></li>
 
 <li>Send the message.
 <ol type="a">
-<li><p>Using the first parameter in the callback (result), the messaging service informs you about the sending status. It can be used to determine whether the sending succeeded:</p>
-<pre class="prettyprint">static void 
+<li><p>Define a callback for the <span style="font-family: Courier New,Courier,monospace;">messages_send_message()</span> function. You can use the callback to let the messaging service inform you about the message sending status. Use the first parameter to determine whether the sending succeeded:</p>
+<pre class="prettyprint">
+static void 
 sent_msg_cb(messages_sending_result_e result, void *user_data)
 {
 &nbsp;&nbsp;&nbsp;if (MESSAGES_SENDING_SUCCEEDED == result) 
@@ -210,13 +230,17 @@ sent_msg_cb(messages_sending_result_e result, void *user_data)
 &nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Message sending failed&quot;);
 &nbsp;&nbsp;&nbsp;}
-}</pre></li>
-<li><p>If the connection to the messaging service is open (<span style="font-family: Courier New,Courier,monospace;">service_handle</span>) and the message itself is successfully created (<span style="font-family: Courier New,Courier,monospace;">msg_hndl</span>), send it using the <span style="font-family: Courier New,Courier,monospace;">messages_send_message()</span> function:</p>
-<pre class="prettyprint">error_code = messages_send_message(service_handle, msg_hndl, true, sent_msg_cb, NULL);
+}
+</pre></li>
+<li><p>If the connection to the messaging service is open (you have the <span style="font-family: Courier New,Courier,monospace;">service_handle</span> handle) and the message itself (<span style="font-family: Courier New,Courier,monospace;">msg_hndl</span>) is successfully created, send the message using the <span style="font-family: Courier New,Courier,monospace;">messages_send_message()</span> function:</p>
+<pre class="prettyprint">
+error_code = messages_send_message(service_handle, msg_hndl, true, 
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sent_msg_cb, NULL);
 if (error_code != MESSAGES_ERROR_NONE) 
 {
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;Failed to send message&quot;);
-}</pre></li></ol></li></ol>
+}
+</pre></li></ol></li></ol>
 
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
index e2a2caf..7c36eeb 100644 (file)
@@ -282,22 +282,22 @@ error_code = contacts_record_set_str(image, _contacts_image.path, caller_id_path
 <li>Set the image record as the contact&#39;s child record:\r
 <pre class="prettyprint">error_code = contacts_record_add_child_record(contact, _contacts_contact.image, image);\r
 </pre>\r
+\r
 <table class="note">\r
    <tbody>\r
     <tr>\r
      <th class="note">Note</th>\r
     </tr>\r
     <tr>\r
-     <td class="note">For an application to insert private images in contacts, it needs to meet the following conditions:\r
-        <ul>\r
-        <li>The application must have the  <span style="font-family: Courier New,Courier,monospace">http://tizen.org/privilege/contact.write</span> privilege.</li>\r
-        <li>The application&#39;s private directory and files must have the <span style="font-family: Courier New,Courier,monospace">read</span> permission of the others, such as <span style="font-family: Courier New,Courier,monospace">644</span>.</li>\r
-        <li>The application can erase the image after destroying the contact record (using the <span style="font-family: Courier New,Courier,monospace">contacts_record_destroy()</span> function).</li>\r
-        </ul>\r
-        </td>\r
+     <td class="note">For an application to insert private images in contacts, the following conditions apply:\r
+        <ul><li>The application must have the <span style="font-family: Courier New,Courier,monospace">http://tizen.org/privilege/contact.write</span> privilege to use the APIs, such as <span style="font-family: Courier New,Courier,monospace">contacts_db_insert_record()</span>.</li>\r
+        <li>The application&#39;s private directory and files must have the <span style="font-family: Courier New,Courier,monospace">read</span> permission of others, such as <span style="font-family: Courier New,Courier,monospace">644</span>. SMACK protects the <span style="font-family: Courier New,Courier,monospace">read</span> permission from the other applications.</li>\r
+        <li>The application can erase the image after destroying the contact record (using the <span style="font-family: Courier New,Courier,monospace">contacts_record_destroy()</span> function).</li></ul>\r
+     </td>\r
     </tr>\r
    </tbody>\r
-  </table>\r
+</table>\r
+\r
 </li></ol></li>\r
 <li>Add an event.\r
 <p>You can add a birthday event associated with the contact. An event contains the date and the event type, among other properties.</p>\r
@@ -2178,7 +2178,7 @@ contacts_record_h hcontact = NULL;
 error_code = contacts_record_create(_contacts_contact._uri, &amp;hcontact);\r
 </pre>\r
 \r
-<p>Creating a group is similar to creating a record. The only difference is using another view  the group view.</p>\r
+<p>Creating a group is similar to creating a record. The only difference is using another view &#45; the group view.</p>\r
 </li>\r
 \r
 <li>Set the properties of the newly created record. Almost every property in the contact view is a record itself, so create more records, as needed. The following example shows how to add an address record to a contact.\r
@@ -2562,7 +2562,7 @@ contacts_filter_h n_filter = NULL;
 contacts_filter_create (_contacts_name._uri, &amp;n_filter);\r
 contacts_filter_add_str(n_filter, _contacts_name.first_name, CONTACTS_MATCH_STARTSWITH, &quot;Ada&quot;);\r
 contacts_filter_add_operator(n_filter, CONTACTS_FILTER_OPERATOR_OR);\r
-contacts_filter_add_str(n_filter, _contacts_name.first_name, CONTACTS_MATCH_STARTSWITH, &quot;Igo&quot;);\r
+contacts_filter_add_str(n_filter, _contacts_name.first_name, CONTACTS_MATCH_STARTSWITH, &quot;Igo&quot;);\r
 </pre></li>\r
 \r
 <li><p>To add an extra filter to a parent filter:</p>\r