Added in API level 1

Media


class Media : MediaStore.Images.ImageColumns

Summary

Constants
static String

The MIME type of this directory of images.

static String

The default sort order for this table

Inherited constants
String ALBUM

Indexed value of MediaMetadataRetriever.METADATA_KEY_ALBUM extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String ALBUM_ARTIST

Indexed value of MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String ARTIST

Indexed value of MediaMetadataRetriever.METADATA_KEY_ARTIST or ExifInterface.TAG_ARTIST extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String AUTHOR

Indexed value of MediaMetadataRetriever.METADATA_KEY_AUTHOR extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String BITRATE

Indexed value of MediaMetadataRetriever.METADATA_KEY_BITRATE extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String BUCKET_DISPLAY_NAME

The primary bucket display name of this media item. This can be useful to present the user a first-level clustering of related media items. This is a read-only column that is automatically computed.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String BUCKET_ID

The primary bucket ID of this media item. This can be useful to present the user a first-level clustering of related media items. This is a read-only column that is automatically computed.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String CAPTURE_FRAMERATE

Indexed value of MediaMetadataRetriever.METADATA_KEY_CAPTURE_FRAMERATE extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_FLOAT , and are read-only and cannot be mutated.

String CD_TRACK_NUMBER

Indexed value of MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String COMPILATION

Indexed value of MediaMetadataRetriever.METADATA_KEY_COMPILATION extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String COMPOSER

Indexed value of MediaMetadataRetriever.METADATA_KEY_COMPOSER extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String DATA

Absolute filesystem path to the media item on disk.

Apps may use this path to do file operations. However, they should not assume that the file is always available. Apps must be prepared to handle any file-based I/O errors that could occur.

From Android 11 onwards, this column is read-only for apps that target R and higher. On those devices, when creating or updating a uri, this column's value is not accepted. Instead, to update the filesystem location of a file, use the values of the DISPLAY_NAME and RELATIVE_PATH columns.

Though direct file operations are supported, ContentResolver.openFileDescriptor(Uri, String) API is recommended for better performance.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .

String DATE_ADDED

The time the media item was first added.
Value is a non-negative timestamp measured as the number of seconds since 1970-01-01T00:00:00Z.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String DATE_EXPIRES

The time the media item should be considered expired. Typically only meaningful in the context of IS_PENDING or IS_TRASHED.

The value stored in this column is automatically calculated when IS_PENDING or IS_TRASHED is changed. The default pending expiration is typically 7 days, and the default trashed expiration is typically 30 days.

Expired media items are automatically deleted once their expiration time has passed, typically during the next device idle period.
Value is a non-negative timestamp measured as the number of seconds since 1970-01-01T00:00:00Z.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String DATE_MODIFIED

Indexed value of File.lastModified() extracted from this media item.
Value is a non-negative timestamp measured as the number of seconds since 1970-01-01T00:00:00Z.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String DATE_TAKEN

Indexed value of MediaMetadataRetriever.METADATA_KEY_DATE or ExifInterface.TAG_DATETIME_ORIGINAL extracted from this media item.

Note that images must define both ExifInterface.TAG_DATETIME_ORIGINAL and ExifInterface#TAG_OFFSET_TIME_ORIGINAL to reliably determine this value in relation to the epoch.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String DISC_NUMBER

Indexed value of MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String DISPLAY_NAME

The display name of the media item.

For example, an item stored at /storage/0000-0000/DCIM/Vacation/IMG1024.JPG would have a display name of IMG1024.JPG.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .

String DOCUMENT_ID

The "document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item. The value is null when no metadata was found.

Each "document ID" is created once for each new resource. Different renditions of that resource are expected to have different IDs.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String DURATION

Indexed value of MediaMetadataRetriever.METADATA_KEY_DURATION extracted from this media item.
Value is a non-negative duration in milliseconds.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String GENERATION_ADDED

Generation number at which metadata for this media item was first inserted. This is useful for apps that are attempting to quickly identify exactly which media items have been added since a previous point in time. Generation numbers are monotonically increasing over time, and can be safely arithmetically compared.

Detecting media additions using generation numbers is more robust than using DATE_ADDED, since those values may change in unexpected ways when apps use File.setLastModified(long) or when the system clock is set incorrectly.

Note that before comparing these detailed generation values, you should first confirm that the overall version hasn't changed by checking MediaStore.getVersion(Context, String), since that indicates when a more radical change has occurred. If the overall version changes, you should assume that generation numbers have been reset and perform a full synchronization pass.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String GENERATION_MODIFIED

Generation number at which metadata for this media item was last changed. This is useful for apps that are attempting to quickly identify exactly which media items have changed since a previous point in time. Generation numbers are monotonically increasing over time, and can be safely arithmetically compared.

Detecting media changes using generation numbers is more robust than using DATE_MODIFIED, since those values may change in unexpected ways when apps use File.setLastModified(long) or when the system clock is set incorrectly.

Note that before comparing these detailed generation values, you should first confirm that the overall version hasn't changed by checking MediaStore.getVersion(Context, String), since that indicates when a more radical change has occurred. If the overall version changes, you should assume that generation numbers have been reset and perform a full synchronization pass.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String GENRE

Indexed value of MediaMetadataRetriever.METADATA_KEY_GENRE extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String HEIGHT

Indexed value of MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT, MediaMetadataRetriever.METADATA_KEY_IMAGE_HEIGHT or ExifInterface.TAG_IMAGE_LENGTH extracted from this media item.

Type: INTEGER
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String INFERRED_DATE

File's approximate creation date.

Following is the derivation logic: 1. If MediaColumns.DATE_TAKEN is present, use it. 2. If MediaColumns.DATE_TAKEN is absent, use MediaColumns.DATE_MODIFIED. Note: When QUERY_ARG_MEDIA_STANDARD_SORT_ORDER query argument is used, the sorting is based on this column in descending order.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String INSTANCE_ID

The "instance ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item. The value is null when no metadata was found.

This "instance ID" changes with each save operation of a specific "document ID".
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String IS_DOWNLOAD

Flag indicating if the media item has been marked as being part of the Downloads collection.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String IS_DRM

Flag indicating if a media item is DRM protected.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String IS_FAVORITE

Flag indicating if the media item has been marked as being a "favorite" by the user.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String IS_PENDING

Flag indicating if a media item is pending, and still being inserted by its owner. While this flag is set, only the owner of the item can open the underlying file; requests from other apps will be rejected.

Pending items are retained either until they are published by setting the field to 0, or until they expire as defined by DATE_EXPIRES.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String IS_TRASHED

Flag indicating if a media item is trashed.

Trashed items are retained until they expire as defined by DATE_EXPIRES.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String MIME_TYPE

The MIME type of the media item.

This is typically defined based on the file extension of the media item. However, it may be the value of the format attribute defined by the Dublin Core Media Initiative standard, extracted from any XMP metadata contained within this media item.

Note: the format attribute may be ignored if the top-level MIME type disagrees with the file extension. For example, it's reasonable for an image/jpeg file to declare a format of image/vnd.google.panorama360+jpg, but declaring a format of audio/ogg would be ignored.

This is a read-only column that is automatically computed.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .

String NUM_TRACKS

Indexed value of MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String OEM_METADATA

Column which allows OEMs to store custom metadata for a media file.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_BLOB , and are read-only and cannot be mutated.

String ORIENTATION

Indexed value of MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION, MediaMetadataRetriever.METADATA_KEY_IMAGE_ROTATION, or ExifInterface.TAG_ORIENTATION extracted from this media item.

For consistency the indexed value is expressed in degrees, such as 0, 90, 180, or 270.

Type: INTEGER
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String ORIGINAL_DOCUMENT_ID

The "original document ID" GUID as defined by the XMP Media Management standard, extracted from any XMP metadata contained within this media item.

This "original document ID" links a resource to its original source. For example, when you save a PSD document as a JPEG, then convert the JPEG to GIF format, the "original document ID" of both the JPEG and GIF files is the "document ID" of the original PSD file.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String OWNER_PACKAGE_NAME

Package name that contributed this media. The value may be NULL if ownership cannot be reliably determined.

From Android Build.VERSION_CODES.UPSIDE_DOWN_CAKE onwards, visibility and query of this field will depend on package visibility. For android.content.ContentResolver#query operation, result set will be restricted to visible packages only.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String RELATIVE_PATH

Relative path of this media item within the storage device where it is persisted. For example, an item stored at /storage/0000-0000/DCIM/Vacation/IMG1024.JPG would have a path of DCIM/Vacation/.

This value should only be used for organizational purposes, and you should not attempt to construct or access a raw filesystem path using this value. If you need to open a media item, use an API like ContentResolver.openFileDescriptor(Uri, String).

When this value is set to NULL during an android.content.ContentResolver#insert operation, the newly created item will be placed in a relevant default location based on the type of media being inserted. For example, a image/jpeg item will be placed under Environment.DIRECTORY_PICTURES.

You can modify this column during an android.content.ContentResolver#update call, which will move the underlying file on disk.

In both cases above, content must be placed under a top-level directory that is relevant to the media type. For example, attempting to place a audio/mpeg file under Environment.DIRECTORY_PICTURES will be rejected.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .

String RESOLUTION

Calculated value that combines WIDTH and HEIGHT into a user-presentable string.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String SIZE

Indexed value of File.length() extracted from this media item.
Value is a non-negative number of bytes.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String TITLE

Indexed value of MediaMetadataRetriever.METADATA_KEY_TITLE extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String VOLUME_NAME

Volume name of the specific storage device where this media item is persisted. The value is typically one of the volume names returned from MediaStore.getExternalVolumeNames(Context).

This is a read-only column that is automatically computed.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String WIDTH

Indexed value of MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH, MediaMetadataRetriever.METADATA_KEY_IMAGE_WIDTH or ExifInterface.TAG_IMAGE_WIDTH extracted from this media item.

Type: INTEGER
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String WRITER

Indexed value of MediaMetadataRetriever.METADATA_KEY_WRITER extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String XMP

Indexed XMP metadata extracted from this media item.

The structure of this metadata is defined by the XMP Media Management standard, published as ISO 16684-1:2012.

This metadata is typically extracted from a ExifInterface.TAG_XMP contained inside an image file or from a XMP_ box contained inside an ISO/IEC base media file format (MPEG-4 Part 12).

Note that any location details are redacted from this metadata for privacy reasons.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_BLOB , and are read-only and cannot be mutated.

String YEAR

Indexed value of MediaMetadataRetriever.METADATA_KEY_YEAR extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String DESCRIPTION

Indexed value of ExifInterface.TAG_IMAGE_DESCRIPTION extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String EXPOSURE_TIME

Indexed value of ExifInterface.TAG_EXPOSURE_TIME extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String F_NUMBER

Indexed value of ExifInterface.TAG_F_NUMBER extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING , and are read-only and cannot be mutated.

String ISO

Indexed value of ExifInterface.TAG_ISO_SPEED_RATINGS extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String IS_PRIVATE

Whether the image should be published as public or private
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String LATITUDE

The latitude where the image was captured.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_FLOAT , and are read-only and cannot be mutated.

String LONGITUDE

The longitude where the image was captured.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_FLOAT , and are read-only and cannot be mutated.

String MINI_THUMB_MAGIC

The mini thumb id.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .

String PICASA_ID

The picasa id of the image
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .

String SCENE_CAPTURE_TYPE

Indexed value of ExifInterface.TAG_SCENE_CAPTURE_TYPE extracted from this media item.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.

String _COUNT

The count of rows in a directory.

Type: INTEGER

String _ID

The unique ID for a row.

Type: INTEGER (long)

Public constructors

Public methods
static Bitmap!

Retrieves an image for the given url as a Bitmap.

static Uri!
getContentUri(volumeName: String!)

Get the content:// style URI for the image media table on the given volume.

static Uri
getContentUri(volumeName: String, id: Long)

Get the content:// style URI for a single row in the images table on the given volume.

static String!
insertImage(cr: ContentResolver!, source: Bitmap!, title: String!, description: String!)

Insert an image and create a thumbnail for it.

static String!
insertImage(cr: ContentResolver!, imagePath: String!, name: String!, description: String!)

Insert an image and create a thumbnail for it.

static Cursor!
query(cr: ContentResolver!, uri: Uri!, projection: Array<String!>!)

static Cursor!
query(cr: ContentResolver!, uri: Uri!, projection: Array<String!>!, where: String!, orderBy: String!)

static Cursor!
query(cr: ContentResolver!, uri: Uri!, projection: Array<String!>!, selection: String!, selectionArgs: Array<String!>!, orderBy: String!)

Properties
static Uri!

The content:// style URI for the "primary" external storage volume.

static Uri!

The content:// style URI for the internal storage.

Constants

CONTENT_TYPE

Added in API level 1
static val CONTENT_TYPE: String

The MIME type of this directory of images. Note that each entry in this directory will have a standard image MIME type as appropriate -- for example, image/jpeg.

Value: "vnd.android.cursor.dir/image"

DEFAULT_SORT_ORDER

Added in API level 1
static val DEFAULT_SORT_ORDER: String

The default sort order for this table

Value: "bucket_display_name"

Public constructors

Media

Added in API level 1
Media()

Public methods

getBitmap

Added in API level 1
Deprecated in API level 29
static fun getBitmap(
    cr: ContentResolver!,
    url: Uri!
): Bitmap!

Deprecated: loading of images should be performed through ImageDecoder.createSource(ContentResolver, Uri), which offers modern features like PostProcessor.

Retrieves an image for the given url as a Bitmap.

Parameters
cr ContentResolver!: The content resolver to use
url Uri!: The url of the image

getContentUri

Added in API level 1
static fun getContentUri(volumeName: String!): Uri!

Get the content:// style URI for the image media table on the given volume.

Parameters
volumeName String!: the name of the volume to get the URI for
Return
Uri! the URI to the image media table on the given volume

getContentUri

Added in API level 30
static fun getContentUri(
    volumeName: String,
    id: Long
): Uri

Get the content:// style URI for a single row in the images table on the given volume.

Parameters
volumeName String: the name of the volume to get the URI for This value cannot be null.
id Long: the image to get the URI for
Return
Uri the URI to the images table on the given volume This value cannot be null.

insertImage

Added in API level 1
Deprecated in API level 29
static fun insertImage(
    cr: ContentResolver!,
    source: Bitmap!,
    title: String!,
    description: String!
): String!

Deprecated: inserting of images should be performed using MediaColumns.IS_PENDING, which offers richer control over lifecycle.

Insert an image and create a thumbnail for it.

Parameters
cr ContentResolver!: The content resolver to use
source Bitmap!: The stream to use for the image
title String!: The name of the image
description String!: The description of the image
Return
String! The URL to the newly created image, or null if the image failed to be stored for any reason.

insertImage

Added in API level 1
Deprecated in API level 29
static fun insertImage(
    cr: ContentResolver!,
    imagePath: String!,
    name: String!,
    description: String!
): String!

Deprecated: inserting of images should be performed using MediaColumns.IS_PENDING, which offers richer control over lifecycle.

Insert an image and create a thumbnail for it.

Parameters
cr ContentResolver!: The content resolver to use
imagePath String!: The path to the image to insert
name String!: The name of the image
description String!: The description of the image
Return
String! The URL to the newly created image

query

Added in API level 1
Deprecated in API level 29
static fun query(
    cr: ContentResolver!,
    uri: Uri!,
    projection: Array<String!>!
): Cursor!

Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.

query

Added in API level 1
Deprecated in API level 29
static fun query(
    cr: ContentResolver!,
    uri: Uri!,
    projection: Array<String!>!,
    where: String!,
    orderBy: String!
): Cursor!

Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.

query

Added in API level 1
Deprecated in API level 29
static fun query(
    cr: ContentResolver!,
    uri: Uri!,
    projection: Array<String!>!,
    selection: String!,
    selectionArgs: Array<String!>!,
    orderBy: String!
): Cursor!

Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.

Properties

EXTERNAL_CONTENT_URI

Added in API level 1
static val EXTERNAL_CONTENT_URI: Uri!

The content:// style URI for the "primary" external storage volume.

INTERNAL_CONTENT_URI

Added in API level 1
static val INTERNAL_CONTENT_URI: Uri!

The content:// style URI for the internal storage.