Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#constants) \| [Inherited Constants](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#inhconstants) \| [Inherited Methods](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#inhmethods)

# ContactsContract.RawContacts.Entity

*** ** * ** ***

` public static final class ContactsContract.RawContacts.Entity `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/provider/BaseColumns, https://developer.android.com/reference/android/provider/ContactsContract.DataColumns `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.ContactsContract.RawContacts.Entity |

<br />

*** ** * ** ***

<br />

A sub-directory of a single raw contact that contains all of its `https://developer.android.com/reference/android/provider/ContactsContract.Data` rows. To access this directory append `https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#CONTENT_DIRECTORY` to the raw contact URI. See `https://developer.android.com/reference/android/provider/ContactsContract.RawContactsEntity` for a stand-alone table containing the same data.

Entity has two ID fields: `https://developer.android.com/reference/android/provider/BaseColumns#_ID` for the raw contact and `https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#DATA_ID` for the data rows. Entity always contains at least one row, even if there are no actual data rows. In this case the `https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#DATA_ID` field will be null.

Using Entity should be preferred to using two separate queries: RawContacts followed by Data. The reason is that Entity reads all data for a raw contact in one transaction, so there is no possibility of the data changing between the two queries.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#CONTENT_DIRECTORY` The directory twig for this sub-table |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.Entity#DATA_ID` The ID of the data row. |

### Inherited constants

From interface `https://developer.android.com/reference/android/provider/BaseColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/BaseColumns#_COUNT`

The count of rows in a directory.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/BaseColumns#_ID`

The unique ID for a row.
From interface `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#CARRIER_PRESENCE`

*This constant was deprecated in API level 31. The contacts database will only show presence information on devices where `https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL` is true, otherwise use `https://developer.android.com/reference/android/telephony/ims/RcsUceAdapter`.*
`int` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#CARRIER_PRESENCE_VT_CAPABLE`

*This constant was deprecated in API level 31. Same as `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#CARRIER_PRESENCE`.*
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA1`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA10`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA11`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA12`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA13`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA14`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA15`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA2`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA3`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA4`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA5`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA6`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA7`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA8`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA9`

Generic data column, the meaning is `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE` specific
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#DATA_VERSION`

The version of this data record.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#IS_PRIMARY`

Whether this is the primary entry of its kind for the raw contact it belongs to.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#IS_READ_ONLY`

The "read-only" flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#IS_SUPER_PRIMARY`

Whether this is the primary entry of its kind for the aggregate contact it belongs to.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#MIMETYPE`

The MIME type of the item represented by this row.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME`

The flattened `https://developer.android.com/reference/android/content/ComponentName` of a `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` that is the preferred `PhoneAccountHandle` to call the contact with.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#PREFERRED_PHONE_ACCOUNT_ID`

The ID of a `https://developer.android.com/reference/android/telecom/PhoneAccountHandle` that is the preferred `PhoneAccountHandle` to call the contact with.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#RAW_CONTACT_ID`

A reference to the `https://developer.android.com/reference/android/provider/BaseColumns#_ID` that this data belongs to.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#RES_PACKAGE`

The package name to use when creating `https://developer.android.com/reference/android/content/res/Resources` objects for this data row.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#SYNC1`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#SYNC2`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#SYNC3`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#SYNC4`

Generic column for use by sync adapters.

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### CONTENT_DIRECTORY

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

```
public static final String CONTENT_DIRECTORY
```

The directory twig for this sub-table

<br />

Constant Value: "entity"

### DATA_ID

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

```
public static final String DATA_ID
```

The ID of the data row. The value will be null if this raw contact has no data rows.

Type: INTEGER

<br />

<br />

Constant Value: "data_id"