<li>If starting any sync jobs without setting account mode, sync request API can not be delivered. So, first of all, create an account or set as accountless.
<p class="figure">Figure: Choice account mode</p>
<p align="center"><img alt="Choice Account" src="../images/syncadapterapp_choice_account.png"/> <img alt="Create Account" src="../images/syncadapterapp_create_account.png"/> <img alt="Set Accountless" src="../images/syncadapterapp_set_accountless.png"/></p>
-<p>If you clicked "Create an account", you can create a dummy account for passing it to sync manager API. Enable sync support on the account.</p>
+<p>If you clicked <strong>Create an account</strong>, you can create a dummy account for passing it to sync manager API. Enable sync support on the account.</p>
<pre class="prettyprint">
static void
create_account()
is_accountless = false;
}</pre>
</li>
-<li>If you clicked "Set as accountless", you can set as accountless without an account to sync manager API.
+<li>If you clicked <strong>Set as accountless</strong>, you can set account mode as accountless to use sync manager API without an account.
<pre class="prettyprint">
static void
set_accountless()
</li>
-<li>Once, the sync manager schedules a sync job for this request, sync callback functions in Sync Adapter Service App will be invoked. Upon completion of the sync job, the service application will communicate the same to Sync Adapter App by using app_control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
+<li>Once, the sync manager schedules a sync job for this request, sync callback functions in Sync Adapter Service App will be invoked. Upon completion of the sync job, the service application will communicate the same to Sync Adapter App by using app control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
<pre class="prettyprint">
static void
app_control(app_control_h app_control, void *data)
<h3>Request Periodic Sync</h3>
<ol>
-<li>To perform Periodic Sync, select <strong>Periodic Sync</strong> from <strong>Start sync with settings</strong>. Click on <strong>Sync</strong> button which will trigger corresponding sync manager API as shown below.
+<li>To perform Periodic Sync, select <strong>Periodic Sync</strong> from <strong>Start sync with settings</strong>. Click on <strong>Start Sync</strong> button which will trigger corresponding sync manager API as shown below.
<pre class="prettyprint">
static void
cb_add_periodic_sync(void* pData, Evas_Object* pObj, void* pEvent_info)
</li>
-<li>Once, the sync manager schedules a sync job for this request, sync callback functions in Sync Adapter Service App will be invoked periodically. Upon completion of the sync job, the service application will communicate the same to Sync Adapter App by using app_control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
+<li>Once, the sync manager schedules a sync job for this request, sync callback functions in Sync Adapter Service App will be invoked periodically. Upon completion of the sync job, the service application will communicate the same to Sync Adapter App by using app control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
<pre class="prettyprint">
static void
app_control(app_control_h app_control, void *data)
<h3>Request Data Change Sync</h3>
<ol>
-<li>To perform Data Change Sync, select <strong>Data Change Sync</strong> from <strong>Start sync with settings</strong>. Click on <strong>ContactSync</strong> button which will trigger corresponding sync manager API as shown below.
+<li>To perform Data Change Sync, select <strong>Data Change Sync</strong> from <strong>Start sync with settings</strong>. Click on <strong>Start Sync</strong> button which will trigger corresponding sync manager API as shown below.
<pre class="prettyprint">
static void
cb_add_data_change_sync(void* pData, Evas_Object* pObj, void* pEvent_info)
</li>
-<li>The sync manager stores the data change sync request. Whenever there is a change in corresponding db which is selected through <strong>Capability types</strong>, sync manager schedules a sync job for the data. Sync callback functions in Sync Adapter Service App will be invoked accordingly. Upon completion of the upload sync job, the service application will communicate the same to Sync Adapter App by using app_control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
+<li>The sync manager stores the data change sync request. Whenever there is a change in corresponding db which is selected through <strong>Capability types</strong>, sync manager schedules a sync job for the data. Sync callback functions in Sync Adapter Service App will be invoked accordingly. Upon completion of the upload sync job, the service application will communicate the same to Sync Adapter App by using app control with its operation. Also, the Sync Adapter App will show a popup to notify the user about the status.
<pre class="prettyprint">
static void
app_control(app_control_h app_control, void *data)
<p align="center"><img alt="Foreach Sync Jobs" src="../images/syncadapterapp_manage_sync_jobs.png"/></p>
<h3>Request to get all sync jobs</h3>
-<li>To query the sync jobs requested by the Sync Adapter App, select <strong>Manage sync jobs</strong> from home screen view. The corresponding sync manager API will be called as shown below.
+<li>To query all sync jobs requested by the Sync Adapter App, select <strong>Manage sync jobs</strong> from home screen view. The corresponding sync manager API will be called as shown below.
<pre class="prettyprint">
bool
sync_adapter_sample_foreach_sync_job_cb(account_h account, const char *sync_job_name, const char *sync_capability, int sync_job_id, bundle* sync_job_user_data, void *user_data)
strcpy(list_of_sync_jobs[temp_idx], sync_job_info);
dlog_print(DLOG_INFO, LOG_TAG, "copy to list_of_sync_jobs[%d] : %s", temp_idx, list_of_sync_jobs[temp_idx]);
- cnt_sync_jobs ++;
+ cnt_sync_jobs++;
return true;
}
<p><img alt="Mobile native" src="../images/mobile_s_n.png"/></p>
</div>
+
+
<h1>Sync Adapter Service Sample Overview</h1>
<p>The Sync Adapter Service App acts as a sync adapter to <a href="./syncadapterapp_sd_mn.htm">Sync Adapter App</a>. The service application handles all sync requests from Sync Adapter App.</p>
+
+
<h2>Prerequisites</h2>
<ol>
<li>To ensure proper application execution, the following privileges must be set:
</li>
</ol>
+
+
<h2>Start Sync</h2>
<h3>Handle Start Sync</h3>
<li>Whenever sync manager schedules a sync job for Sync Adapter App, the following callback function will be tirgger to perform the sync job.
-The Sync Adapter Service App will communicates to Sync Adapter App by using app_control.
+The Sync Adapter Service App will communicates to Sync Adapter App by using app control.
<pre class="prettyprint">
static bool handleStartSync(account_h account, const char *sync_job_name, const char *sync_capability, bundle *sync_job_user_data)
{
</li>
-<h2>Cancel Sync</h2>
-<h3>Handle Cancel Sync</h3>
-<li>This callback function is a notification to inform Sync Adapter Service App to safely cancel ongoing sync job (if any).
+
+<h2>Stop Sync</h2>
+<h3>Handle Stop Sync</h3>
+<li>This callback function is a notification to inform Sync Adapter Service App to stop and safely cancel ongoing sync job (if any).
<pre class="prettyprint">
static void handleStopSync(account_h account, const char *capability)
{
}</pre>
</li>
+
+
<script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../scripts/showhide.js"></script>
</div></div></div>