added some contents for ACR-364.
authorIckhee Woo <ickhee.woo@samsung.com>
Sun, 9 Aug 2015 05:00:24 +0000 (14:00 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Sun, 9 Aug 2015 05:00:24 +0000 (14:00 +0900)
Change-Id: I2ab0c26e6ff6c88857914484ffd2566db3278b3a
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
org.tizen.guides/html/native/account/sync_manager_n.htm
org.tizen.tutorials/html/native/account/sync_manager_tutorial_n.htm

index 48d9861..45dce82 100644 (file)
      <th class="note">Note</th>
     </tr>
     <tr>
-     <td class="note">The Sync Manager API domain is supported in mobile applications only.</td>
+     <td class="note">The Sync Manager API domain is supported in mobile applications only. Service and UI applications should have package name as same.</td>
     </tr>
    </tbody>
  </table>
 
-<p>On the device, you can receive notifications when the data changes in the calendar or contacts. To receive the notifications, you must define the applicable capabilities (<span style="font-family: Courier New,Courier,monospace">http://tizen.org/account/capability/calendar</span> for the calendar changes and <span style="font-family: Courier New,Courier,monospace">http://tizen.org/account/capability/contact</span> for the contact changes). If you use the <a href="../../../../org.tizen.native.mobile.apireference/group__CORE__LIB__BUNDLE__MODULE.html">Bundle</a> API, you can deliver the change data to the callback function in the form of <span style="font-family: Courier New,Courier,monospace">user_data</span> by using a key-value pair.</p>
+<p>On the device, you can receive notifications when the data changes in the calendar or contacts. To receive the notifications, you must define the applicable capabilities (<span style="font-family: Courier New,Courier,monospace">http://tizen.org/account/capability/calendar</span> for the calendar changes and <span style="font-family: Courier New,Courier,monospace">http://tizen.org/account/capability/contact</span> for the contact changes). If you use the <a href="../../../../org.tizen.native.mobile.apireference/group__CORE__LIB__BUNDLE__MODULE.html">Bundle</a> API, you can deliver the change data to the callback function in the form of <span style="font-family: Courier New,Courier,monospace">user_data</span> by using a key-value pair. <br>The periodic sync API can set alarm for calculation of periodic sync job. So, in the case of using sync_manager_add_periodic_sync_job(), <span style="font-family: Courier New,Courier,monospace">http://tizen.org/privilege/alarm.set</span> should be registered first in each setting file of UI application.</p>
 
 <p>The main Sync Manager API features are:</p>
 <ul>
     </tr>
     <tr>
      <td>Data on the server changes</td>
-     <td>When the data changes on a server, a push message arrives from a server. The server sends the push message to the account provider service and service applications.</td>
+     <td>The server sends the push message to the account provider service and service applications. When the data changes on a server, a push message arrives from a server. Then, the device which received the push message can trigger on-demand sync job.</td>
     </tr>
     <tr>
      <td>Data on the device changes</td>
-     <td>Changes are based on capabilities. The data change listener notices the changes by using the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CALENDAR__SVC__MODULE.html">Calendar</a> or <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__MODULE.html">Contacts</a> API. If there are any changes in the calendar or contacts data, the sync manager notices the changes and schedules a sync job. 
-        <p>Changing data in the Calendar database includes adding, updating, and deleting books, events, and todos. Changing data in the Contacts database includes adding, removing, and modifying contacts.</p></td>
+     <td>Changes are based on capabilities. The data change listener notices the changes by using the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CALENDAR__SVC__MODULE.html">Calendar</a> or <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__MODULE.html">Contacts</a> API. If there are any changes in the calendar or contacts data, the sync manager notices the changes and schedules a sync job.
+<p>Changing data in the Calendar database includes adding, updating, and deleting books, events, and todos. Changing data in the Contacts database includes adding, removing, and modifying contacts.</p></td>
     </tr>
     <tr>
      <td>Network availability</td>
@@ -81,7 +81,7 @@
     </tr>
     <tr>
      <td>Sync schedule intervals</td>
-     <td>Sync schedule intervals mean that you can schedule a sync job to be performed regularly. You can use this feature with the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_periodic_sync_job()</span> function. You can define the sync intervals with various enumerators provided through the Sync Manager API.</td>
+     <td>Sync schedule intervals mean that you can schedule a sync job to be performed regularly. You can use this feature with the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_periodic_sync_job()</span> function. You can define the sync intervals with various enumerators provided through the Sync Manager API. Setable values of period are provided only multiple of 30minutes as enums.</td>
     </tr>
    </tbody>
   </table>
 <li><span style="font-family: Courier New,Courier,monospace">SYNC_OPTION_EXPEDITED</span>
 <p>All sync jobs are passed into a sync job queue. If this sync option is set to <span style="font-family: Courier New,Courier,monospace">true</span>, it gives a priority to its job relative to the other queued jobs. Both the on-demand and periodic jobs in the queue are simultaneously influenced by this option.</p></li></ul>
 
-  
+
 <h2>Sync Adapter</h2>
- <p>The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__ADAPTER__MODULE.html">Sync Adapter</a> API allows you to:</p>
+<p>The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__ADAPTER__MODULE.html">Sync Adapter</a> API allows you to:</p>
+
+ <table class="note">
+   <tbody>
+    <tr>
+     <th class="note">Note</th>
+    </tr>
+    <tr>
+     <td class="note">The Sync Adapter API should be carried out by a service application which will operate data synchronization before using the Sync Manager API.</td>
+    </tr>
+   </tbody>
+ </table>
+
+<p>The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__ADAPTER__MODULE.html">Sync Adapter</a> API allows you to:</p>
 <ul>
 <li>Register callbacks for notifications about the sync job start and cancellation.</li>
 <li>Use an app control to start or cancel the sync operation, so that the application daemon does not need to stay awake.
 
-<p>With the app control mechanism, you can use specific operations exported by other Tizen applications. The mechanism allows you to receive notifications when starting or canceling a sync job without using the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__APP__CONTROL__MODULE.html">App Control</a> API separately. When an app control is used, the application does not need to be in the running state to receive the notifications.</p>
+<p>With the app control mechanism, you can use specific operations exported by other Tizen applications. The mechanism allows you to receive notifications when starting or canceling a sync job without using the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__APP__CONTROL__MODULE.html">App Control</a> API separately. <br>When an app control is used, the application does not need to be in the running state to receive the notifications.</p>
 <p>The following table defines the app control operation details related to a sync operation. The applications does not need to know about them, because the operations are set primitively in the daemon.</p>
   <table>
   <caption>Table: App control operations
 
 </li>
 </ul>
-  
-  
+
+
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
 </div></div></div>
index 0c36bf3..e3e314a 100644 (file)
@@ -50,7 +50,7 @@
      <th class="note">Note</th>
     </tr>
     <tr>
-     <td class="note">This feature is supported in mobile applications only.</td>
+     <td class="note">These features are supported in mobile applications only. To use the features of the Sync Manager API, <a href="#set_callback">Setting the Callback Functions</a> should be carried out first by a service application. <br>An UI application can not initialize and set callbacks through using the Sync Adapter API. On the contrary, the Sync Manager API can be called to request sync operations by UI application.</td>
     </tr>
    </tbody>
  </table>
 <p>To inform the service application of a one-time sync operation:</p>
 
 <ol>
-<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__MANAGER__MODULE.html">Sync Manager</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_manager.h&gt;</span> header file in your application:
+<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__MANAGER__MODULE.html">Sync Manager</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_manager.h&gt;</span> header file in your UI application:
 <pre class="prettyprint">
 #include &lt;sync_manager.h&gt;
 </pre>
 </li>
 
-<li><a href="#set_callback">Set the sync adapter callbacks</a>:
+<li><a href="#set_callback">Set the sync adapter callbacks</a> in your service application:
 <pre class="prettyprint">
 #include &lt;sync_adapter.h&gt;
 
@@ -103,7 +103,7 @@ result = sync_manager_connect();
 </pre>
 </li>
 
-<li>If you want to use an account (track calendar or contact data changes on the device), create the account and the bundle to obtain the parameters for the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_sync_job()</span> function you need later on. 
+<li>If you want to use an account (track calendar or contact data changes on the device), create the account and the bundle to obtain the parameters for the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_sync_job()</span> function you need later on.
 <p>The account handle is not a mandatory parameter, because it is meant for an application that uses the sync manager without an account. For more information, see <a href="../social/account_tutorial_n.htm">Creating and Managing an Account</a> and <a href="../app_framework/bundle_tutorial_n.htm">Managing and Using the Bundle Content</a>.</p>
 
 <pre class="prettyprint">
@@ -138,7 +138,7 @@ result = sync_manager_add_sync_job(NULL, NULL, extra);
 <p>If the sync job addition process succeeds, the <span style="font-family: Courier New,Courier,monospace">SYNC_ERROR_NONE</span> value is returned.</p>
 </li>
 
-<li>When the on-demand sync is no longer needed, remove it with the <span style="font-family: Courier New,Courier,monospace">sync_manager_remove_sync_job()</span> function. If you want to stop using the account too, clean up the account handle. 
+<li>When the on-demand sync is no longer needed, remove it with the <span style="font-family: Courier New,Courier,monospace">sync_manager_remove_sync_job()</span> function. If you want to stop using the account too, clean up the account handle.
 <p>At the end, disconnect from the sync manager and release the resources with the <span style="font-family: Courier New,Courier,monospace">sync_manager_disconnect()</span> function.</p>
 <pre class="prettyprint">
 result = sync_manager_remove_sync_job(account, capability);
@@ -162,19 +162,19 @@ sync_adapter_destroy();
 </pre>
 </li>
 </ol>
-               
+
 <h2 id="periodic_sync" name="periodic_sync">Initializing the Periodic Sync</h2>
 
 <p>To inform the service application of a periodical sync operation and its sync interval:</p>
 
 <ol>
-<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__MANAGER__MODULE.html">Sync Manager</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_manager.h&gt;</span> header file in your application:
+<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__MANAGER__MODULE.html">Sync Manager</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_manager.h&gt;</span> header file in your UI application:
 <pre class="prettyprint">
 #include &lt;sync_manager.h&gt;
 </pre>
 </li>
 
-<li><a href="#set_callback">Set the sync adapter callbacks</a>:
+<li><a href="#set_callback">Set the sync adapter callbacks</a> in your service application:
 <pre class="prettyprint">
 #include &lt;sync_adapter.h&gt;
 
@@ -196,7 +196,7 @@ result = sync_manager_connect();
 </pre>
 </li>
 
-<li>If you want to use an account (track calendar or contact data changes on the device), create the account and the bundle to obtain the parameters for the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_sync_job()</span> function you need later on. 
+<li>If you want to use an account (track calendar or contact data changes on the device), create the account and the bundle to obtain the parameters for the <span style="font-family: Courier New,Courier,monospace">sync_manager_add_sync_job()</span> function you need later on.
 <p>The account handle is not a mandatory parameter, because it is meant for an application that uses the sync manager without an account. For more information, see <a href="../social/account_tutorial_n.htm">Creating and Managing an Account</a> and <a href="../app_framework/bundle_tutorial_n.htm">Managing and Using the Bundle Content</a>.</p>
 
 <pre class="prettyprint">
@@ -246,17 +246,20 @@ sync_adapter_destroy();
 <p>To set callbacks to receive notifications about sync operations:</p>
 
 <ol>
-<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__ADAPTER__MODULE.html">Sync Adapter</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_adapter.h&gt;</span> header file in your application:
+<li>To use the features of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYNC__ADAPTER__MODULE.html">Sync Adapter</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;sync_adapter.h&gt;</span> header file in your service application:
 <pre class="prettyprint">
 #include &lt;sync_adapter.h&gt;
 </pre>
 </li>
 
-<li>Initialize the sync adapter instance using the <span style="font-family: Courier New,Courier,monospace">sync_adapter_init()</span> function:
+<li>Initialize the sync adapter instance using the <span style="font-family: Courier New,Courier,monospace">sync_adapter_init()</span> function.
+<p>If both capabilities are defined (you can receive notification about both data changes on the device and set periodic sync job for both capabilities):</p>
 <pre class="prettyprint">
 int result;
-const char* capability = &quot;http://tizen.org/account/capability/calendar&quot;;
-result = sync_adapter_init(capability);
+const char* capability_cal = &quot;http://tizen.org/account/capability/calendar&quot;;
+const char* capability_con = &quot;http://tizen.org/account/capability/contact&quot;;
+result = sync_adapter_init(capability_cal);
+result = sync_adapter_init(capability_con);
 </pre>
 <p>If no capabilities are defined (you do not want to receive notifications about calendar or contact data changes on the device):</p>
 <pre class="prettyprint">