Getting a custom Sync Service and Adapter to show up under "Data and Synchronization" on Android

Originally published on eve.gd on 14 January 2011, last updated 6 September 2026.

Read this post on the web (with images, PDF and citation details)

As mentioned previously, the two part tutorial on c99.org is a great starting place for people wanting to write their own synchronization service for Android. The only problem is that, because it syncs to Contacts, it omits to tell you what to do to get your new service appearing under Settings -> Accounts -> "Data and Synchronization".

two
part

The answer is surprisingly simple, but also elusive. As the tutorial stated, you certainly need:

      <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
          android:contentAuthority="com.martineve.mendroid.data.mendeleycollectionsprovider"
          android:accountType="com.martineve.mendroid.account"
          android:supportsUploading="true"
	  android:userVisible="true"/>

This on its own, however, is not necessarily enough. It turns out that the check Android performs to ascertain whether to display a sync item underneath the "Data and Synchronization" panel is a call to ContentResolver.getIsSyncable(account), which has to return a positive integer value. This means that, in certain cases (of which I remain unsure), you'll need to call:

ContentResolver.setIsSyncable(account, "com.martineve.mendroid.data.mendeleycollectionsprovider", 1);

... probably on some form of application startup/install.

If you need further guidance on this, I'd suggest browsing through my work at the Mendeley for Android Google Code repository.

Mendeley for Android Google Code repository

References

This reference list has been generated, in many cases, through an automated process and may therefore contain errors or incomplete metadata. It is provided purely as assistance for finding the items mentioned within this post.

1. Mendeley for Android Google Code repository <http://code.google.com/p/mendeley-for-android/>

2. ‘Writing an Android Sync Provider: Part 1’, Did You Win Yet? <http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/>

3. ‘Writing an Android Sync Provider: Part 2’, Did You Win Yet? <http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/>

http://code.google.com/p/mendeley-for-android/
http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/
http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/