I implemented a sync task the same way as the BasicSyncAdapter example except with a Google account like in this answer:
https://stackoverflow.com/a/2972918/2072569
It works on allmost all devices except for the Samsung SM-P600 (Galaxy Note 2014) with Android 4.4.2 and some other Samsung tablets.
My ContentProvider in the Manifest file has a label. This is the cause of this bug according to this post at some Android version of some Samsung tablets.
Has Samsung blocked adding sync tasks to a Google account for some reason?
The sync is added like this:
removeAllSyncTasks();
ContentResolver.setIsSyncable(mAccount, CONTENT_AUTHORITY, 1);
ContentResolver.setSyncAutomatically(mAccount, CONTENT_AUTHORITY, true);
ContentResolver.addPeriodicSync(mAccount, CONTENT_AUTHORITY, Bundle.EMPTY, SYNC_FREQUENCY);
Manifest part:
<service
android:name=".data.sync.SyncService"
android:exported="true"
android:process=":sync">
<intent-filter>
<action android:name="android.content.SyncAdapter"/>
</intent-filter>
<meta-data android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
<provider
android:name=".data.provider.LevensContentProvider"
android:authorities="@string/authority"
android:label="@string/app_name_sync"
android:exported="false"
android:syncable="true" />
Syncadapter xml:
<?xml version="1.0" encoding="utf-8"?>
<sync-adapter
xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="@string/authority"
android:accountType="com.google"
android:userVisible="true"
android:supportsUploading="true"
android:allowParallelSyncs="false"
android:isAlwaysSyncable="true"/>
When I manually start the sync. The Syncservice is also not starting at the Samsung tablets (it works on all other devices).