Android 4.x: Get a list of custom account types in contacts

I am trying to write my own sync adapter for Android. I dig through the Sample Sync Adapter from the SDK, but it is terribly undocumented. I can make contacts in the contacts application. But they were not able to edit them or create new ones.

It is very difficult to find information on how to get your own type of account, specified for creating default contacts in the application, or making them editable. I do not want to add any custom fields just stΓΌff and data already supported by android.

Can someone point me to a tutorial or examples of how to integrate my synchronization adapter into the default contacts application (e.g. exchange synchronization)?

  • What you need to add to AndroidManifest.xml
  • What you need to add to contacts.xml
  • What you need to add to syncadapter.xml
  • Is there any code that needs to be added to work?

By the way:
I don't care about Android versions lower than ICS. I read everywhere that the 2.x app does not support this, but 3.x and higher. 2.x is disconnected from the table, so I'm looking for an ICS way to do this.

Thanks at Advance

+4
source share
2 answers

I think it's a bit late to answer this question, but I had this problem and finally it was solved. In android 4.x you can add a contact to only three types of android account. 1) Google account, 2) Exchange account, 3) Recordable account and record, this means that your contactss.xml file must contain the EditSchema tag. You should also add the following tag to the manifest file:

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

And near EditSchema , there is a good example in the following URL:

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.3_r1/packages/apps/Contacts/tests/res/xml/test_basic_contacts.xml

You just need to copy the contents of the xml file and paste it into the contacts.xml file (you can configure xml if you want). And everything is done!

+6
source

Look at this:

Change user contact in cellular format

I asked this question before, and I opened up generosity to get an answer. The answer was that, although the feature is present in Honeycomb, it is not documented anywhere. You need to go through the code to find out how to do this.

Now I have found that there is some documentation here, for example: Social Networking API Blog

0
source

All Articles