0

Is it possible to add a custom field with an icon, in Contacts in Android. I saw in DATA_15 field, BLOB can be added. But I don't know how. Kindly help.

Thanks in advance.

Jayakrishnan Salim
  • 977
  • 1
  • 10
  • 24
  • read carefully ContactsContract.Data documentation – pskink Apr 20 '15 at 11:27
  • is it suitable for you? http://stackoverflow.com/questions/21701017/display-the-app-icon-if-the-contact-is-associated-with-the-application-in-phone http://stackoverflow.com/a/27921895/2781108 – Hasanaga Apr 20 '15 at 11:30
  • @Hasanaga: I know that adding a sync adapter and account authenticator, I can add my app icon in a contact in the contacts app. But, is there a way to update this icon? Like an online status? – Jayakrishnan Salim Apr 20 '15 at 11:54
  • why do you want a "sync adapter and account authenticator" ? – pskink Apr 20 '15 at 12:27
  • @pskink: If I am wrong, please tell me the exact way of achieving this. – Jayakrishnan Salim Apr 20 '15 at 16:44
  • have you read: http://developer.android.com/reference/android/provider/ContactsContract.Data.html ? just add a row with your custom MIMETYPE – pskink Apr 20 '15 at 16:47
  • @pskink: Still I am not able to understand how can I set an icon as a custom field in contacts. Kindly provide me more information. – Jayakrishnan Salim Apr 20 '15 at 16:50
  • get a Cursor for ContactsContract.Datal#CONTENT_URI for one particular RAW_CONTACT_ID and see how data is stored in ContactsContract.Data – pskink Apr 20 '15 at 16:54
  • @pskink: What could be the MIMETYPE to add an icon field? I could see some of the common MIMETYPEs defined by Android in ContactsContract.CommonDataKinds class. But this won't suite my need I guess. Please help. – Jayakrishnan Salim Apr 21 '15 at 06:50
  • you can use any unique MIMETYPE: for example email uses `vnd.android.cursor.item/email_v2` you can use `vnd.android.cursor.item/your.package.whatever` – pskink Apr 21 '15 at 07:02
  • @pskink I tried same but still facing an issue..I am able to see my app in Accounts Section with an option to sync Contacts but still my app is not showing in Contact detail page..please check- https://stackoverflow.com/questions/52905223/app-added-in-accounts-with-contact-sync-option-but-not-showing-in-contact-detail – Android Developer Oct 22 '18 at 06:37
  • @pskink I have added code with issue at github- https://github.com/bhuvnesh123/AppContactSyncSamplegithub.com/bhuvnesh123/AppContactSyncSample ..I have also opened bounty on question..thanks – Android Developer Oct 22 '18 at 16:32

0 Answers0