# ContactsContract.Contacts.AggregationSuggestions

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# AggregationSuggestions

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/provider/ContactsContract.Contacts.AggregationSuggestions "View this page in Java")  

```
class AggregationSuggestions : BaseColumns, ContactsContract.ContactOptionsColumns, ContactsContract.ContactStatusColumns, ContactsContract.ContactsColumns
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                         ||
| ↳ | [android.provider.ContactsContract.Contacts.AggregationSuggestions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions#) |

A*read-only*sub-directory of a single contact aggregate that contains all aggregation suggestions (other contacts). The aggregation suggestions are computed based on approximate data matches with this contact.

*Note: this query may be expensive! If you need to use it in bulk, make sure the user experience is acceptable when the query runs for a long time.*

Usage example:  

```kotlin
Uri uri = Contacts.CONTENT_URI.buildUpon()
           .appendEncodedPath(String.valueOf(contactId))
           .appendPath(Contacts.AggregationSuggestions.CONTENT_DIRECTORY)
           .appendQueryParameter("limit", "3")
           .build()
  Cursor cursor = getContentResolver().query(suggestionsUri,
           new String[] {Contacts.DISPLAY_NAME, Contacts._ID, Contacts.LOOKUP_KEY},
           null, null, null);
  
```

<br />

This directory can be used either with a[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts#CONTENT_URI:android.net.Uri)or[CONTENT_LOOKUP_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts#CONTENT_LOOKUP_URI:android.net.Uri).

## Summary

|                                                                                            Nested classes                                                                                             ||
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder) A convenience builder for aggregation suggestion content URIs. |

|                                                                                                                                              Constants                                                                                                                                               ||
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENT_DIRECTORY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions#CONTENT_DIRECTORY:kotlin.String) The directory twig for this sub-table. |

| Inherited constants ||
|---|---|
| From class[ContactStatusColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns) |----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_CHAT_CAPABILITY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_CHAT_CAPABILITY:kotlin.String) <br /> Contact Chat Capabilities. See[StatusUpdates](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.StatusUpdates)for individual definitions. Type: NUMBER <br />                                                                                                                        | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_PRESENCE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_PRESENCE:kotlin.String) <br /> Contact presence status. See[StatusUpdates](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.StatusUpdates)for individual status definitions. Type: NUMBER <br />                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_STATUS](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS:kotlin.String) <br /> Contact's latest status update. Type: TEXT <br />                                                                                                                                                                                                                                                                                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_STATUS_ICON](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_ICON:kotlin.String) <br /> The resource ID of the icon for the source of contact status. This resource is scoped by the[CONTACT_STATUS_RES_PACKAGE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_RES_PACKAGE:kotlin.String). Type: NUMBER <br />                               | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_STATUS_LABEL](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_LABEL:kotlin.String) <br /> The resource ID of the label describing the source of contact status, e.g. "Google Talk". This resource is scoped by the[CONTACT_STATUS_RES_PACKAGE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_RES_PACKAGE:kotlin.String). Type: NUMBER <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_STATUS_RES_PACKAGE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_RES_PACKAGE:kotlin.String) <br /> The package containing resources for this status: label and icon. Type: TEXT <br />                                                                                                                                                                                                                           | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_STATUS_TIMESTAMP](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactStatusColumns#CONTACT_STATUS_TIMESTAMP:kotlin.String) <br /> The absolute time in milliseconds when the latest status was inserted/updated. Type: NUMBER <br />                                                                                                                                                                                                                | ||
| From class[ContactsColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTACT_LAST_UPDATED_TIMESTAMP](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP:kotlin.String) <br /> Timestamp (milliseconds since epoch) of when this contact was last updated. This includes updates to all data associated with this contact including raw contacts. Any modification (including deletes and inserts) of underlying contact data are also reflected in this timestamp. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DISPLAY_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#DISPLAY_NAME:kotlin.String) <br /> The display name for the contact. Type: TEXT <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [HAS_PHONE_NUMBER](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#HAS_PHONE_NUMBER:kotlin.String) <br /> An indicator of whether this contact has at least one phone number. "1" if there is at least one phone number, "0" otherwise. Type: INTEGER <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [IN_DEFAULT_DIRECTORY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#IN_DEFAULT_DIRECTORY:kotlin.String) <br /> Flag that reflects whether the contact exists inside the default directory. Ie, whether the contact is designed to only be visible outside search. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [IN_VISIBLE_GROUP](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#IN_VISIBLE_GROUP:kotlin.String) <br /> Flag that reflects the[Groups.GROUP_VISIBLE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.GroupsColumns#GROUP_VISIBLE:kotlin.String)state of any[CommonDataKinds.GroupMembership](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.GroupMembership)for this contact. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [IS_USER_PROFILE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#IS_USER_PROFILE:kotlin.String) <br /> Flag that reflects whether this contact represents the user's personal profile entry. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LOOKUP_KEY](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#LOOKUP_KEY:kotlin.String) <br /> An opaque value that contains hints on how to find the contact if its row id changed as a result of a sync or aggregation. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [NAME_RAW_CONTACT_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#NAME_RAW_CONTACT_ID:kotlin.String) <br /> Reference to the row in the RawContacts table holding the contact name. Type: INTEGER REFERENCES raw_contacts(_id) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHOTO_FILE_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_FILE_ID:kotlin.String) <br /> Photo file ID of the full-size photo. If present, this will be used to populate[PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String). The ID can also be used with[ContactsContract.DisplayPhoto.CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_URI:android.net.Uri)to create a URI to the photo. If this is present,[PHOTO_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_ID:kotlin.String)is also guaranteed to be populated. Type: INTEGER <br />                                                                                                                                                                                                                                                                                                                                                                        | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHOTO_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_ID:kotlin.String) <br /> Reference to the row in the data table holding the photo. A photo can be referred to either by ID (this field) or by URI (see[PHOTO_THUMBNAIL_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI:kotlin.String)and[PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String)). If PHOTO_ID is null, consult[PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String)or[PHOTO_THUMBNAIL_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI:kotlin.String), which is a more generic mechanism for referencing the contact photo, especially for contacts returned by non-local directories (see[Directory](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Directory)). Type: INTEGER REFERENCES data(_id) <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHOTO_THUMBNAIL_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI:kotlin.String) <br /> A URI that can be used to retrieve a thumbnail of the contact's photo. A photo can be referred to either by a URI (this field or[PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String)) or by ID (see[PHOTO_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_ID:kotlin.String)). If PHOTO_ID is not null, PHOTO_URI and PHOTO_THUMBNAIL_URI shall not be null (but not necessarily vice versa). If the content provider does not differentiate between full-size photos and thumbnail photos, PHOTO_THUMBNAIL_URI and[PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String)can contain the same value, but either both shall be null or both not null. Type: TEXT <br />                                                                                                                                | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PHOTO_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_URI:kotlin.String) <br /> A URI that can be used to retrieve the contact's full-size photo. If PHOTO_FILE_ID is not null, this will be populated with a URI based off[ContactsContract.DisplayPhoto.CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_URI:android.net.Uri). Otherwise, this will be populated with the same value as[PHOTO_THUMBNAIL_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_THUMBNAIL_URI:kotlin.String). A photo can be referred to either by a URI (this field) or by ID (see[PHOTO_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_ID:kotlin.String)). If either PHOTO_FILE_ID or PHOTO_ID is not null, PHOTO_URI and PHOTO_THUMBNAIL_URI shall not be null (but not necessarily vice versa). Thus using PHOTO_URI is a more robust method of retrieving contact photos. Type: TEXT <br />                                                                | ||
| From class[ContactOptionsColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns) |----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CUSTOM_RINGTONE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#CUSTOM_RINGTONE:kotlin.String) <br /> URI for a custom ringtone associated with the contact. If null or missing, the default ringtone is used. Type: TEXT (URI to the ringtone) <br />                                                                                                                                                                                                            | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LAST_TIME_CONTACTED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#LAST_TIME_CONTACTED:kotlin.String) <br /> The last time a contact was contacted. **Caution:** If you publish your app to the Google Play Store, this field is obsolete, regardless of Android version. For more information, see the[Contacts Provider](https://developer.android.com/reference/kotlin/guide/topics/providers/contacts-provider#ObsoleteData)page. Type: INTEGER <br />       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PINNED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#PINNED:kotlin.String) <br /> The position at which the contact is pinned. If[PinnedPositions.UNPINNED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PinnedPositions#UNPINNED:kotlin.Int), the contact is not pinned. Also see[PinnedPositions](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.PinnedPositions). Type: INTEGER <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SEND_TO_VOICEMAIL](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#SEND_TO_VOICEMAIL:kotlin.String) <br /> Whether the contact should always be sent to voicemail. If missing, defaults to false. Type: INTEGER (0 for false, 1 for true) <br />                                                                                                                                                                                                                   | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [STARRED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#STARRED:kotlin.String) <br /> Is the contact starred? Type: INTEGER (boolean) <br />                                                                                                                                                                                                                                                                                                                      | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [TIMES_CONTACTED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactOptionsColumns#TIMES_CONTACTED:kotlin.String) <br /> The number of times a contact has been contacted. **Caution:** If you publish your app to the Google Play Store, this field is obsolete, regardless of Android version. For more information, see the[Contacts Provider](https://developer.android.com/reference/kotlin/guide/topics/providers/contacts-provider#ObsoleteData)page. Type: INTEGER <br />    | ||
| From class[BaseColumns](https://developer.android.com/reference/kotlin/android/provider/BaseColumns) |----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [_COUNT](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_COUNT:kotlin.String) <br /> The count of rows in a directory. Type: INTEGER <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [_ID](https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String) <br /> The unique ID for a row. Type: INTEGER (long) <br />         | ||

## Constants

### CONTENT_DIRECTORY

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CONTENT_DIRECTORY: String
```

The directory twig for this sub-table. The URI can be followed by an optional type-to-filter, similar to[android.provider.ContactsContract.Contacts#CONTENT_FILTER_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts#CONTENT_FILTER_URI:android.net.Uri).  

    Value: "suggestions"