# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Inherited Constants | Fields | Inherited Methods

# ContactsContract.PhoneLookup

`public static final class ContactsContract.PhoneLookup`
`extends Object` `implements BaseColumns, ContactsContract.PhoneLookupColumns, ContactsContract.ContactsColumns, ContactsContract.ContactOptionsColumns, ContactsContract.ContactNameColumns`

java.lang.Object
↳ | android.provider.ContactsContract.PhoneLookup

A table that represents the result of looking up a phone number, for example for caller ID. To perform a lookup you must append the number you want to find to `CONTENT_FILTER_URI`. This query is highly optimized.

     Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
     resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME,...

### Columns

PhoneLookup
String | `ContactsContract.PhoneLookupColumns.NUMBER` | read-only | Phone number.
String | `ContactsContract.PhoneLookupColumns.TYPE` | read-only | Phone number type. See `CommonDataKinds.Phone`.
String | `ContactsContract.PhoneLookupColumns.LABEL` | read-only | Custom label for the phone number. See `CommonDataKinds.Phone`.

Columns from the Contacts table are also available through a join.

Join with `Contacts`
long | `BaseColumns._ID` | read-only | Contact ID.
long | `ContactsContract.PhoneLookupColumns.CONTACT_ID` | read-only | Contact ID.
long | `ContactsContract.PhoneLookupColumns.DATA_ID` | read-only | Data ID.
String | `ContactsContract.ContactsColumns.LOOKUP_KEY` | read-only | See `ContactsContract.Contacts`
String | `ContactsContract.ContactsColumns.DISPLAY_NAME` | read-only | See `ContactsContract.Contacts`
long | `ContactsContract.ContactsColumns.PHOTO_ID` | read-only | See `ContactsContract.Contacts`.
int | `ContactsContract.ContactsColumns.IN_VISIBLE_GROUP` | read-only | See `ContactsContract.Contacts`.
int | `ContactsContract.ContactsColumns.HAS_PHONE_NUMBER` | read-only | See `ContactsContract.Contacts`.
int | `ContactsContract.ContactOptionsColumns.STARRED` | read-only | See `ContactsContract.Contacts`.
String | `ContactsContract.ContactOptionsColumns.CUSTOM_RINGTONE` | read-only | See `ContactsContract.Contacts`.
int | `ContactsContract.ContactOptionsColumns.SEND_TO_VOICEMAIL` | read-only | See `ContactsContract.Contacts`.

## Summary

### Constants
`String` | `QUERY_PARAMETER_SIP_ADDRESS` If this boolean parameter is set to true, then the appended query is treated as a SIP address and the lookup will be performed against SIP addresses in the user's contacts.

### Inherited constants
From interface `android.provider.BaseColumns`
`String` | `_COUNT` The count of rows in a directory.
`String` | `_ID` The unique ID for a row.
From interface `android.provider.ContactsContract.PhoneLookupColumns`
`String` | `CONTACT_ID` A reference to the `ContactsContract.Contacts#_ID` that this data belongs to.
`String` | `DATA_ID` The ID of the data row.
`String` | `LABEL` The user defined label for the phone number.
`String` | `NORMALIZED_NUMBER` The phone number's E164 representation.
`String` | `NUMBER` The phone number as the user entered it.
`String` | `TYPE` The type of phone number, for example Home or Work.
From interface `android.provider.ContactsContract.ContactsColumns`
`String` | `CONTACT_LAST_UPDATED_TIMESTAMP` Timestamp (milliseconds since epoch) of when this contact was last updated.
`String` | `DISPLAY_NAME` The display name for the contact.
`String` | `HAS_PHONE_NUMBER` An indicator of whether this contact has at least one phone number.
`String` | `IN_DEFAULT_DIRECTORY` Flag that reflects whether the contact exists inside the default directory.
`String` | `IN_VISIBLE_GROUP` Flag that reflects the `Groups#GROUP_VISIBLE` state of any `CommonDataKinds.GroupMembership` for this contact.
`String` | `IS_USER_PROFILE` Flag that reflects whether this contact represents the user's personal profile entry.
`String` | `LOOKUP_KEY` 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.
`String` | `NAME_RAW_CONTACT_ID` Reference to the row in the RawContacts table holding the contact name.
`String` | `PHOTO_FILE_ID` Photo file ID of the full-size photo.
`String` | `PHOTO_ID` Reference to the row in the data table holding the photo.
`String` | `PHOTO_THUMBNAIL_URI` A URI that can be used to retrieve a thumbnail of the contact's photo.
`String` | `PHOTO_URI` A URI that can be used to retrieve the contact's full-size photo.
From interface `android.provider.ContactsContract.ContactOptionsColumns`
`String` | `CUSTOM_RINGTONE` URI for a custom ringtone associated with the contact.
`String` | `LAST_TIME_CONTACTED` This constant is deprecated. Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This column always contains 0.
`String` | `PINNED` The position at which the contact is pinned.
`String` | `SEND_TO_VOICEMAIL` Whether the contact should always be sent to voicemail.
`String` | `STARRED` Is the contact starred? Type: INTEGER (boolean)
`String` | `TIMES_CONTACTED` This constant is deprecated. Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This column always contains 0.
From interface `android.provider.ContactsContract.ContactNameColumns`
`String` | `DISPLAY_NAME_ALTERNATIVE` An alternative representation of the display name, such as "family name first" instead of "given name first" for Western names.
`String` | `DISPLAY_NAME_PRIMARY` The standard text shown as the contact's display name, based on the best available information for the contact (for example, it might be the email address if the name is not available).
`String` | `DISPLAY_NAME_SOURCE` The kind of data that is used as the display name for the contact, such as structured name or email address.
`String` | `PHONETIC_NAME` Pronunciation of the full name in the phonetic alphabet specified by `PHONETIC_NAME_STYLE`.
`String` | `PHONETIC_NAME_STYLE` The phonetic alphabet used to represent the `PHONETIC_NAME`.
`String` | `SORT_KEY_ALTERNATIVE` Sort key based on the alternative representation of the full name, `DISPLAY_NAME_ALTERNATIVE`.
`String` | `SORT_KEY_PRIMARY` Sort key that takes into account locale-based traditions for sorting names in address books.

### Fields
`public static final Uri` | `CONTENT_FILTER_URI` The content:// style URI for this table.
`public static final Uri` | `ENTERPRISE_CONTENT_FILTER_URI` URI used for the "enterprise caller-id".

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### QUERY_PARAMETER_SIP_ADDRESS

    public static final String QUERY_PARAMETER_SIP_ADDRESS

If this boolean parameter is set to true, then the appended query is treated as a SIP address and the lookup will be performed against SIP addresses in the user's contacts.

Constant Value: "sip"

## Fields

### CONTENT_FILTER_URI

    public static final Uri CONTENT_FILTER_URI

The content:// style URI for this table.

Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page. Append the phone number you want to lookup to this URI and query it to perform a lookup. For example:

     Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
             Uri.encode(phoneNumber));

### ENTERPRISE_CONTENT_FILTER_URI

    public static final Uri ENTERPRISE_CONTENT_FILTER_URI

URI used for the "enterprise caller-id".

Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.

It supports the same semantics as `CONTENT_FILTER_URI` and returns the same columns. If the device has no corp profile that is linked to the current profile, it behaves in the exact same way as `CONTENT_FILTER_URI`. If there is a corp profile linked to the current profile, it first queries against the personal contact database, and if no matching contacts are found there, then queries against the corp contacts database.

If a result is from the corp profile, it makes the following changes to the data:

- `ContactsContract.ContactsColumns.PHOTO_THUMBNAIL_URI` and `ContactsContract.ContactsColumns.PHOTO_URI` will be rewritten to special URIs. Use `ContentResolver#openAssetFileDescriptor` or its siblings to load pictures from them. `ContactsContract.ContactsColumns.PHOTO_ID` and `ContactsContract.ContactsColumns.PHOTO_FILE_ID` will be set to null. Do not use them.
- Corp contacts will get artificial `BaseColumns._ID`s. In order to tell whether a contact is from the corp profile, use `ContactsContract.Contacts#isEnterpriseContactId(long)`.
- Corp contacts will get artificial `ContactsContract.ContactsColumns.LOOKUP_KEY`s too.
- Returned work contact IDs and lookup keys are not accepted in places that not explicitly say to accept them.

A contact lookup URL built by `ContactsContract.Contacts#getLookupUri(long, String)` with an `BaseColumns._ID` and a `ContactsContract.ContactsColumns.LOOKUP_KEY` returned by this API can be passed to `ContactsContract.QuickContact#showQuickContact` even if a contact is from the corp profile.

     Uri lookupUri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
             Uri.encode(phoneNumber));

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*