test
test

Reputation: 63

Android filter contacts in application

I made an app that extracts contacts and shows them. My problem is that is pick all contacts from all accounts (skype,viber etc.) This thing can be filtered ??

Upvotes: 0

Views: 652

Answers (1)

M Allen
M Allen

Reputation: 31

The Android contacts store aggregates all contacts from all accounts (Which does vary by vendor implementation e.g. HTC stores XML data in the notes field of the contact row).

The aggregated information is available via ContactsContract.Contacts API and gives the most complete version of all contact data in the contacts store with aggregation conflicts and resolutions already dealt with. If you simply want to access information about contacts that meet a certain requirement e.g. they must have a phone number, then I would suggest this API as it allows for SQLite-esque WHERE clauses.

If you want to access raw contact information separated by account that they came from with no aggregation applied, then use the ContactsContract.RawContacts API (Documentation). This would typically be more appropriate when you're editing contact information as an insert or update query will trigger re-aggregation of the device's contact stores.

Upvotes: 1

Related Questions