What does ContactsContract.Contacts.IN_VISIBLE_GROUP mean in Android?

The Android developer documentation is all I got:

An indicator of whether this contact should be displayed in the user interface. “1” if the contact has at least one raw contact that belongs to the visible group; "0" otherwise.

In essence, what does this mean? What is the purpose of using this flag?

I tried experimenting with contacts for quite a while, and the results look confusing. When I connect contacts with this flag, it selects the contacts, which, in my opinion, are the last synchronized contacts with my Google account, plus the one I added locally in the default phone book. For example, this happens around 912 contacts.

However, when this flag is off, I get a huge number of contacts, some of which I hardly recognize or understand why they are here in the first place. This allows you to get about 3050 contacts!

Appreciate any help!

+5
source share
1 answer

Android contacts are stored within Accounts (such as Google, Yahoo, Linkedin, Microsoft Exchange) in each account, contacts are stored in Groups (for example, friends, family, business contacts), as well as a special group for contacts that do not belong to either which group, this group is usually called " All others in <group-name> ").

In most contacts of applications delivered with Android, the user can select the Custom view, in which he can make groups in accounts visible or hidden on the main contacts screen, for example, the user can choose to display Friends group, but not Family group in his Google Contacts account .

This selection will refer to the application requesting contacts using the IN_VISIBLE_GROUP field, this will be true if the contact is part of the visible group of at least one . The All others in special group is almost always not a visible group, so it is usually hidden from the Contacts application.

In particular, at Google, when you send a message to someone or receive an email from someone, the email address is automatically added to your contacts, to the All others in group, so you probably get a huge number of contacts when you request without this flag.

0
source

Source: https://habr.com/ru/post/1213944/


All Articles