I work on a CardDAV sync source for Android 2.3.3, and I don't understand a thing.
I read carefully the document about samplesyncadaptater, which works only for reading contacts from distant server.
But in my case, I'm trying to add a source that is allowed to both read contact from server and write contact to server.
At this point:
Please help me I put my different xml files...
Here's the Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="android.carddav"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission
android:name="android.permission.GET_ACCOUNTS" />
<uses-permission
android:name="android.permission.USE_CREDENTIALS" />
<uses-permission
android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission
android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission
android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.WRITE_SETTINGS" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission
android:name="android.permission.READ_CONTACTS" />
<uses-permission
android:name="android.permission.WRITE_CONTACTS" />
<uses-permission
android:name="android.permission.READ_SYNC_STATS" />
<uses-permission
android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission
android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<service
android:name=".authenticator.AuthenticationService"
android:exported="true">
<intent-filter>
<action
android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<service
android:name=".syncadapter.SyncService"
android:exported="true" android:enabled="true">
<intent-filter>
<action
android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
<activity
android:name=".authenticator.CardDAVActivity"
android:label="@string/app_name"
android:excludeFromRecents="true">
</activity>
</application>
</manifest>
Here's the syncadaptater.xml:
and finally here's the authenticator.xml:
my response is there : https://stackoverflow.com/a/11153652/1195001 you need to create an activity with the data fields you need, and call it with the intent filter in the link.