Question

Hello dear Stackoverflowers !

I work on a CardDAV sync source for Android 2.3.3, and I don't understand a think. I read carefully the document about samplesyncadaptater, which works only for reading contacts from distant serveur.
But in my case, I'm trying to add a source that aloud to both read contact from server and write contact to server.

At this point:
- My project appears when you want to add a sync source in Android.
- I can parametize my source and authentication works
- When I go to contact app and go to the account visibility option (menu name depends of your phone rom) I can select my source to show its contact
- but when I try to create a contact, only my gmail and outlook source are provided. Maybe I miss someting in the various xml file I need.

Plz 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:

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top