1

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.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

2

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.

marmor
  • 27,641
  • 11
  • 107
  • 150
  • I think we can use AccountManager to loop the device's accounts and try to find what I need, maybe! – Raul Tunduc Aug 22 '17 at 08:06
  • yes, that's how i got to my list of phone-contacts and sim-contacts – marmor Aug 22 '17 at 09:48
  • So how do you get the SIM account-name and account-type? Someone mentioned that he queried ContactsContract.Settings.CONTENT_URI to get it , but I can't see the query: https://stackoverflow.com/q/45875690/878126 – android developer Feb 21 '23 at 09:55