Hi Vadim, Actually for what I've understood the custom mime type can be used to specify how to render the custom fields when you view the contact not while you edit it. I've found a bug in the Contacts application (around line 178): http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=src/com/android/contacts/model/Sources.java;h=f664fb1d13d87f5efca857872da544848ac473b9;hb=HEAD
The ExternalSource component should be able to read the xml file you mentioned above and render it in the contacts editing screen, but... it doesn't. The Facebook application, for example, defines a custom filed (the FB profile) in the contacts.xml file, and it i rendered correctly when you view a FB contact, but the FB account in Android is a read only account, it means that in any case you cannot create/edit contacts from android. Up to now I found only a workaroun, filtering the intent launched everytime a contact must be created/edited and show a custom contacts edit screen, for our contacts account, or forward the request to the default contacts app if the contact belongs to a different account. Let me know if you've found any other workaround. Thank you Carlo On Dec 23, 3:16 pm, Vadim Vohmjanin <[email protected]> wrote: > I have found something... > > For that custom Data row to appear in the Contacts app, you'll need to > associate your custom MIME-type with XML that describes how to render > the UI. The only current way of doing this is to define a sync > adapter <service> and add <meta-data> definition inside, something > like this: > > <meta-data android:name="android.provider.CONTACTS_STRUCTURE" > android:resource="@xml/contacts" /> > > So you have 2 metas there, one is for sync adapter. > > Then define the contacts XML inside your app ./res/xml/contacts.xml: > > --snip-- > <ContactsSource xmlns:android="http://schemas.android.com/apk/res/ > android";> > <ContactsDataKind > android:mimeType="vnd.com.example.voip.cursor.item/phone_v2" > android:icon="@drawable/icon" > android:summaryColumn="data2" > android:detailColumn="data3" /> > </ContactsSource> > --snip-- > > I have tried this, but i didn't get it working. It sure effects in > some way. But i don't get desirable result. > > Any help pls? > > On Dec 18, 4:32 pm, Vadim Vohmjanin <[email protected]> wrote: > > > I faced the same problem. > > > I'm doing the research now. If you have found how to do it, please > > provide this info. I'd be very greatfull. > > > I also wanted to know, what exactly way do you create custom account? > > As i understood account creation currently *requires* a developer to > > implement a > > service that extends AbstractThreadedSyncAdapter and publishes the > > correct intent in > > its manifest. > > When this is not the case, the "Accounts & Sync" settings does not > > handle the case > > where this is not defined and causes the NPE in the core process that > > causes the > > reboot. > > It is recommended that this defect be patch and/or the documentation > > updated to include the > > proper procedures and requirements for creation of an account in > > Android. > > > Also account creation requires of the authenticator to be implemented > > for the account type. > > In order to be an authenticator developer must extend > > AbstractAccountAuthenticator class, provider implementations for the > > abstract methods and write a service that returns implemented > > AccountAuthenticator. > > > Or there is more simple way to create a custom account for Contacts? > > > On Dec 15, 4:52 pm, sazilla <[email protected]> wrote: > > > > Hi everyone, > > > > I encountered an issue while configuring my own account for android > > > contacts sync. When the user choses to add a new contact to the custom > > > account, only the name fields and the photo are showed. This behaviour > > > can be found in the ExternalSource.java android source file. > > > > My question is, if I don't want to add custom contacts fields for my > > > account, how can I configure the account to show all the standard > > > fields in the contacts application in the same way the google account > > > does? > > > > Thank you > > > > Carlo -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

