ydario: please keep the public discourse public:

On Wed, Dec 9, 2009 at 2:52 PM, ydario <mc6...@mclink.it> wrote:
> Hello,
>
>> programmers are meant to register a new account type, provide a sync
>> adapter for that account type, and provide an xml CONTACTS_STRUCTURE
>> for that account type.
>
> I'm trying to get Contacts application to show my personal fields, but
> I'm unable to register my service/application.
>
> Adding in my manifest things like
>
>                <service android:exported="true"
>                        android:name=".gbService">
>                        <intent-filter>
>                        <action android:name="android.content.SyncAdapter"/>
>                        </intent-filter>
>                        <meta-data 
> android:name="android.provider.CONTACTS_STRUCTURE"
>                                android:resource="@xml/contacts" />
>                </service>
>
> results in error while installing package, like 'no sync-adapter
> metadata'. It seems to me that an intent filter is required, at least
> looking at how ExternaSource.java works.
>
>
> Could you provide some more info?

You need two meta-data entries: one for the CONTACTS_STRUCTURE and one
for the sync adapter.  Something like this:

                <service android:exported="true"
                        android:name=".gbService">
                        <intent-filter>
                        <action android:name="android.content.SyncAdapter"/>
                        </intent-filter>
                        <meta-data android:name="android.content.SyncAdapter"

android:resource="@xml/syncadapter_description"/>
                        <meta-data
android:name="android.provider.CONTACTS_STRUCTURE"
                                android:resource="@xml/contacts" />
                </service>

See the (limited) sync adapter documentation for details on preparing
res/xml/syncadapter_description.xml.

Of course the original question still stands: The fields that you
specify in res/xml/contacts.xml don't come up in the contacts app.  It
appears that the code that processes the actual fields is not in
place.  Of course this may not matter for folks who don't wish to use
the stock android Contacts app to edit the custom fields.

Ciao,
Brian

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to