Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Contact sync adapter in android

Tags:

People also ask

What is sync adapter in android?

The sync adapter component in your app encapsulates the code for the tasks that transfer data between the device and a server. Based on the scheduling and triggers you provide in your app, the sync adapter framework runs the code in the sync adapter component.

How do I turn on auto sync on Android?

Step 1: Tap the menu in the top left to see your preferences and other options. Step 2: Tap on the Manage Auto Sync text to open auto sync preferences on your device. Step 3: Tap the green Turn Auto Sync On button to enable auto sync.


I want to use sync adapter in my application to sync the native and third party contacts (except FB) with server. ( Only client to server one way sync)

I have two doubts here -

1) If there are multiple sync adapters in the device and If dirty bit is already cleared by another sync adapter , would my sync adapter be able to detect the contacts change/update immediately.

2) I have used

ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1);
ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true);     

to sync the contacts with server .

It does start the sync in every 30 seconds .

But I want it to get notified immediately when ever contacts are added Or Deleted or Updated to start perfromSync operation.

Do I need to use observer too ?