1

So, I can write to and retrieve info from the ContactsContract, however I have a question about how it works.

It is my understanding that all contact information for Contacts are stored within ContactsContract.Contact and ContactsContract.Data (ContactsContract.CommonDataDataKinds.Phone/Email/etc are all references to ContactsContract.Data, right?). A majority of this info is stored within ContactsContract.Data.DATA1-15.

Ignoring contact groups, if I wanted to create a contact app, do I only need to worry about DATA1-DATA15 for storing actual numbers/email/address/birthday/etc? What happens if a contact has more than 14 pieces of contact data (DATA15 is a blob)?

Am I missing something vital?

Edit - I'm looking more into it, and it seems like the common MIME types may be the best way of searching. If I search the following MIMETYPES:

StructuredName.CONTENT_ITEM_TYPE 
Phone.CONTENT_ITEM_TYPE
Email.CONTENT_ITEM_TYPE
Photo.CONTENT_ITEM_TYPE 
Organization.CONTENT_ITEM_TYPE
Im.CONTENT_ITEM_TYPE 
Nickname.CONTENT_ITEM_TYPE
Note.CONTENT_ITEM_TYPE 
StructuredPostal.CONTENT_ITEM_TYPE
GroupMembership.CONTENT_ITEM_TYPE 
Website.CONTENT_ITEM_TYPE
Event.CONTENT_ITEM_TYPE 
Relation.CONTENT_ITEM_TYPE
SipAddress.CONTENT_ITEM_TYPE

Will that handle everything? It's probably important to note that I'm using ContactsContract.Contacts.CONTENT_FILTER_URI as my search query. My goal is to have a similar effect as the standard app, where if I search, I can display the matching field below the contact's name.

Thanks for the help.

Matt
  • 1,392
  • 12
  • 24

0 Answers0