lightbulb_outline Please take our October 2018 developer survey. Start survey

MediaStore.Video.Thumbnails

public static class MediaStore.Video.Thumbnails
extends Object implements BaseColumns

java.lang.Object
   ↳ android.provider.MediaStore.Video.Thumbnails


This class allows developers to query and get two kinds of thumbnails: MINI_KIND: 512 x 384 thumbnail MICRO_KIND: 96 x 96 thumbnail

Summary

Constants

String DATA

Path to the thumbnail file on disk.

String DEFAULT_SORT_ORDER

The default sort order for this table

int FULL_SCREEN_KIND

String HEIGHT

The height of the thumbnail

Type: INTEGER (long)

String KIND

The kind of the thumbnail

Type: INTEGER (One of the values below)

int MICRO_KIND

int MINI_KIND

String VIDEO_ID

The original image for the thumbnal

Type: INTEGER (ID from Video table)

String WIDTH

The width of the thumbnal

Type: INTEGER (long)

Inherited constants

Fields

public static final Uri EXTERNAL_CONTENT_URI

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

public static final Uri INTERNAL_CONTENT_URI

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

Public constructors

MediaStore.Video.Thumbnails()

Public methods

static void cancelThumbnailRequest(ContentResolver cr, long origId)

This method cancels the thumbnail request so clients waiting for getThumbnail will be interrupted and return immediately.

static void cancelThumbnailRequest(ContentResolver cr, long origId, long groupId)

This method cancels the thumbnail request so clients waiting for getThumbnail will be interrupted and return immediately.

static Uri getContentUri(String volumeName)

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

static Bitmap getThumbnail(ContentResolver cr, long origId, long groupId, int kind, BitmapFactory.Options options)

This method checks if the thumbnails of the specified image (origId) has been created.

static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, BitmapFactory.Options options)

This method checks if the thumbnails of the specified image (origId) has been created.

Inherited methods

Constants

DATA

added in API level 5
public static final String DATA

Path to the thumbnail file on disk.

Note that apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps should use ContentResolver.openFileDescriptor(Uri, String) to gain access.

Type: TEXT

Constant Value: "_data"

DEFAULT_SORT_ORDER

added in API level 5
public static final String DEFAULT_SORT_ORDER

The default sort order for this table

Constant Value: "video_id ASC"

FULL_SCREEN_KIND

added in API level 5
public static final int FULL_SCREEN_KIND

Constant Value: 2 (0x00000002)

HEIGHT

added in API level 5
public static final String HEIGHT

The height of the thumbnail

Type: INTEGER (long)

Constant Value: "height"

KIND

added in API level 5
public static final String KIND

The kind of the thumbnail

Type: INTEGER (One of the values below)

Constant Value: "kind"

MICRO_KIND

added in API level 5
public static final int MICRO_KIND

Constant Value: 3 (0x00000003)

MINI_KIND

added in API level 5
public static final int MINI_KIND

Constant Value: 1 (0x00000001)

VIDEO_ID

added in API level 5
public static final String VIDEO_ID

The original image for the thumbnal

Type: INTEGER (ID from Video table)

Constant Value: "video_id"

WIDTH

added in API level 5
public static final String WIDTH

The width of the thumbnal

Type: INTEGER (long)

Constant Value: "width"

Fields

EXTERNAL_CONTENT_URI

added in API level 5
public static final Uri EXTERNAL_CONTENT_URI

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

INTERNAL_CONTENT_URI

added in API level 5
public static final Uri INTERNAL_CONTENT_URI

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

Public constructors

MediaStore.Video.Thumbnails

added in API level 5
public MediaStore.Video.Thumbnails ()

Public methods

cancelThumbnailRequest

added in API level 5
public static void cancelThumbnailRequest (ContentResolver cr, 
                long origId)

This method cancels the thumbnail request so clients waiting for getThumbnail will be interrupted and return immediately. Only the original process which made the getThumbnail requests can cancel their own requests.

Parameters
cr ContentResolver: ContentResolver

origId long: original video id

cancelThumbnailRequest

added in API level 8
public static void cancelThumbnailRequest (ContentResolver cr, 
                long origId, 
                long groupId)

This method cancels the thumbnail request so clients waiting for getThumbnail will be interrupted and return immediately. Only the original process which made the getThumbnail requests can cancel their own requests.

Parameters
cr ContentResolver: ContentResolver

origId long: original video id

groupId long: the same groupId used in getThumbnail.

getContentUri

added in API level 5
public static Uri getContentUri (String volumeName)

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

Returns
Uri the URI to the image media table on the given volume

getThumbnail

added in API level 8
public static Bitmap getThumbnail (ContentResolver cr, 
                long origId, 
                long groupId, 
                int kind, 
                BitmapFactory.Options options)

This method checks if the thumbnails of the specified image (origId) has been created. It will be blocked until the thumbnails are generated.

Parameters
cr ContentResolver: ContentResolver used to dispatch queries to MediaProvider.

origId long: Original image id associated with thumbnail of interest.

groupId long: the id of group to which this request belongs

kind int: The type of thumbnail to fetch. Should be either MINI_KIND or MICRO_KIND

options BitmapFactory.Options: this is only used for MINI_KIND when decoding the Bitmap

Returns
Bitmap A Bitmap instance. It could be null if the original image associated with origId doesn't exist or memory is not enough.

getThumbnail

added in API level 5
public static Bitmap getThumbnail (ContentResolver cr, 
                long origId, 
                int kind, 
                BitmapFactory.Options options)

This method checks if the thumbnails of the specified image (origId) has been created. It will be blocked until the thumbnails are generated.

Parameters
cr ContentResolver: ContentResolver used to dispatch queries to MediaProvider.

origId long: Original image id associated with thumbnail of interest.

kind int: The type of thumbnail to fetch. Should be either MINI_KIND or MICRO_KIND.

options BitmapFactory.Options: this is only used for MINI_KIND when decoding the Bitmap

Returns
Bitmap A Bitmap instance. It could be null if the original image associated with origId doesn't exist or memory is not enough.