Android APIs
public static final class

MediaStore.Images.Media

extends Object
implements MediaStore.Images.ImageColumns
java.lang.Object
   ↳ android.provider.MediaStore.Images.Media

Summary

Constants
String CONTENT_TYPE The MIME type of of this directory of images.
String DEFAULT_SORT_ORDER The default sort order for this table
[Expand]
Inherited Constants
From interface android.provider.MediaStore.Images.ImageColumns
From interface android.provider.MediaStore.MediaColumns
From interface android.provider.BaseColumns
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.Images.Media()
Public Methods
final static Bitmap getBitmap(ContentResolver cr, Uri url)
Retrieves an image for the given url as a Bitmap.
static Uri getContentUri(String volumeName)
Get the content:// style URI for the image media table on the given volume.
final static String insertImage(ContentResolver cr, String imagePath, String name, String description)
Insert an image and create a thumbnail for it.
final static String insertImage(ContentResolver cr, Bitmap source, String title, String description)
Insert an image and create a thumbnail for it.
final static Cursor query(ContentResolver cr, Uri uri, String[] projection, String where, String orderBy)
final static Cursor query(ContentResolver cr, Uri uri, String[] projection, String selection, String[] selectionArgs, String orderBy)
final static Cursor query(ContentResolver cr, Uri uri, String[] projection)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CONTENT_TYPE

Added in API level 1

The MIME type of 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.

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

public static final String DEFAULT_SORT_ORDER

Added in API level 1

The default sort order for this table

Constant Value: "bucket_display_name"

Fields

public static final Uri EXTERNAL_CONTENT_URI

Added in API level 1

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

public static final Uri INTERNAL_CONTENT_URI

Added in API level 1

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

Public Constructors

public MediaStore.Images.Media ()

Added in API level 1

Public Methods

public static final Bitmap getBitmap (ContentResolver cr, Uri url)

Added in API level 1

Retrieves an image for the given url as a Bitmap.

Parameters
cr The content resolver to use
url The url of the image
Returns
Bitmap
Throws
FileNotFoundException
IOException
FileNotFoundException

public static Uri getContentUri (String volumeName)

Added in API level 1

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

Parameters
volumeName the name of the volume to get the URI for
Returns
Uri the URI to the image media table on the given volume

public static final String insertImage (ContentResolver cr, String imagePath, String name, String description)

Added in API level 1

Insert an image and create a thumbnail for it.

Parameters
cr The content resolver to use
imagePath The path to the image to insert
name The name of the image
description The description of the image
Returns
String The URL to the newly created image
Throws
FileNotFoundException

public static final String insertImage (ContentResolver cr, Bitmap source, String title, String description)

Added in API level 1

Insert an image and create a thumbnail for it.

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

public static final Cursor query (ContentResolver cr, Uri uri, String[] projection, String where, String orderBy)

Added in API level 1

Parameters
cr
uri
projection
where
orderBy
Returns
Cursor

public static final Cursor query (ContentResolver cr, Uri uri, String[] projection, String selection, String[] selectionArgs, String orderBy)

Added in API level 1

Parameters
cr
uri
projection
selection
selectionArgs
orderBy
Returns
Cursor

public static final Cursor query (ContentResolver cr, Uri uri, String[] projection)

Added in API level 1

Parameters
cr
uri
projection
Returns
Cursor