Create a contact with a custom account type created using the sync adapter

I wrote my own sync adapter for Android. I can make contacts in the contacts application. But they were not able to create new ones for this type of account using the default Contact application in android.

It is very difficult to find any information on how to get your own type of account, specified to create default contacts in the application when creating a contact

+4
source share
1 answer

Only three kinds of account in android.

1) Google Account,

2) Exchange account,

3) , contactss.xml EditSchema.

EditSchema, 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

android contacts.xml.

 </service>
 <service android:name="com.example.ContactsSyncAdapterService"      
android:enabled="true" android:exported="true" android:process=":contacts">
 <intent-filter>
<action android:name="android.content.SyncAdapter" /> 
</intent-filter>
<meta-data android:name="android.content.SyncAdapter"   
 android:resource="@xml/sync_contacts" />

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

.. .. .

, -.

+1

Source: https://habr.com/ru/post/1534406/


All Articles