# ContactsContract.DisplayPhoto

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

# DisplayPhoto

*** ** * ** ***

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

```
class DisplayPhoto
```

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

Helper class for accessing full-size photos by photo file ID.

Usage example:

Retrieving a full-size photo by photo file ID (see[ContactsContract.ContactsColumns.PHOTO_FILE_ID](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.ContactsColumns#PHOTO_FILE_ID:kotlin.String))
:

    ```kotlin
    public InputStream openDisplayPhoto(long photoFileId) {
          Uri displayPhotoUri = ContentUris.withAppendedId(DisplayPhoto.CONTENT_URI, photoKey);
          try {
              AssetFileDescriptor fd = getContentResolver().openAssetFileDescriptor(
                  displayPhotoUri, "r");
              return fd.createInputStream();
          } catch (IOException e) {
              return null;
          }
      }
      
    ```

<br />

## Summary

|                                                                                                                                                                                                                                                                                    Constants                                                                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DISPLAY_MAX_DIM](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#DISPLAY_MAX_DIM:kotlin.String) Queries to[ContactsContract.DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_MAX_DIMENSIONS_URI:android.net.Uri)will contain this column, populated with the maximum height and width (in pixels) that will be stored for a display photo. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [THUMBNAIL_MAX_DIM](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#THUMBNAIL_MAX_DIM:kotlin.String) Queries to[ContactsContract.DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_MAX_DIMENSIONS_URI:android.net.Uri)will contain this column, populated with the height and width (in pixels) for photo thumbnails.                        |

|                                                                                                                                                                         Properties                                                                                                                                                                         ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [CONTENT_MAX_DIMENSIONS_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_MAX_DIMENSIONS_URI:android.net.Uri) This URI allows the caller to query for the maximum dimensions of a display photo or thumbnail. |
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_URI:android.net.Uri) The content:// style URI for this class, which allows access to full-size photos, given a key.                                |

## Constants

### DISPLAY_MAX_DIM

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

```
static val DISPLAY_MAX_DIM: String
```

Queries to[ContactsContract.DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_MAX_DIMENSIONS_URI:android.net.Uri)will contain this column, populated with the maximum height and width (in pixels) that will be stored for a display photo. Larger photos will be down-sized to fit within a square of this many pixels.  

    Value: "display_max_dim"

### THUMBNAIL_MAX_DIM

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

```
static val THUMBNAIL_MAX_DIM: String
```

Queries to[ContactsContract.DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.DisplayPhoto#CONTENT_MAX_DIMENSIONS_URI:android.net.Uri)will contain this column, populated with the height and width (in pixels) for photo thumbnails.  

    Value: "thumbnail_max_dim"

## Properties

### CONTENT_MAX_DIMENSIONS_URI

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

```
static val CONTENT_MAX_DIMENSIONS_URI: Uri!
```

This URI allows the caller to query for the maximum dimensions of a display photo or thumbnail. Requests to this URI can be performed on the UI thread because they are always unblocking.  

### CONTENT_URI

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

```
static val CONTENT_URI: Uri!
```

The content:// style URI for this class, which allows access to full-size photos, given a key.