androidandroid-contactsbulkinsertaccountmanager

How can I get the default phone and SIM contact's ACCOUNT_TYPE and ACCOUNT_NAME?


I want to get the default phone and SIM ACCOUNT_NAME and ACCOUNT_TYPE.
On some devices, when I try to save a contact, it is not showing in the default Contact app of the device (like SONY or ASUS).
It doesn't work when I try to pass null at ACCOUNT_NAME and ACCOUNT_TYPE, when saving the contact by bulk insertion.


Solution

  • Each device maker puts whatever it wants as the account type and name for the phone's phone-contacts, I've compiled a list for the major makers here: https://stackoverflow.com/a/44802016/819355

    Regarding SIM contacts, almost all makers use: vnd.sec.contact.sim as account_type, except OPPO which uses: com.oppo.contacts.sim.

    If you have any items to add to these lists, please add in comments.