Partager via


MediaStore Class

Definition

The contract between the media provider and applications.

[Android.Runtime.Register("android/provider/MediaStore", DoNotGenerateAcw=true)]
public sealed class MediaStore : Java.Lang.Object
[<Android.Runtime.Register("android/provider/MediaStore", DoNotGenerateAcw=true)>]
type MediaStore = class
    inherit Object
Inheritance
MediaStore
Attributes

Remarks

The contract between the media provider and applications. Contains definitions for the supported URIs and columns.

The media provider provides an indexed collection of common media types, such as Audio, Video, and Images, from any attached storage devices. Each collection is organized based on the primary MIME type of the underlying content; for example, image/* content is indexed under Images. The Files collection provides a broad view across all collections, and does not filter by MIME type.

Java documentation for android.provider.MediaStore.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MediaStore()

Fields

AccessMediaOwnerPackageNamePermission

Permission that grants access to MediaColumns#OWNER_PACKAGE_NAME of every accessible media file.

ActionImageCapture

Standard Intent action that can be sent to have the camera application capture an image and return it.

ActionImageCaptureSecure

Intent action that can be sent to have the camera application capture an image and return it when the device is secured (e.

ActionPickImages

Activity Action: Allow the user to select images or videos provided by system and return it.

ActionPickImagesSettings

Activity Action: Launch settings controlling images or videos selection with #ACTION_PICK_IMAGES.

ActionReview

Standard action that can be sent to review the given media file.

ActionReviewSecure

Standard action that can be sent to review the given media file when the device is secured (e.

ActionVideoCapture

Standard Intent action that can be sent to have the camera application capture a video and return it.

Authority

The authority for the media provider

ExtraAcceptOriginalMediaFormat

Specify that the caller wants to receive the original media format without transcoding.

ExtraBrightness

When defined, the launched application is requested to set the given brightness value via android.view.WindowManager.LayoutParams#screenBrightness to help ensure a smooth transition when launching #ACTION_REVIEW or #ACTION_REVIEW_SECURE intents.

ExtraDurationLimit

Specify the maximum allowed recording duration in seconds.

ExtraFinishOnCompletion

The name of the Intent-extra used to control the onCompletion behavior of a MovieView.

ExtraFullScreen

The name of an Intent-extra used to control the UI of a ViewImage.

ExtraMediaAlbum

The name of the Intent-extra used to define the album

ExtraMediaArtist

The name of the Intent-extra used to define the artist

ExtraMediaCapabilities

Specify the ApplicationMediaCapabilities that should be used while opening a media.

ExtraMediaCapabilitiesUid

Specify the UID of the app that should be used to determine supported media capabilities while opening a media.

ExtraMediaFocus

The name of the Intent-extra used to define the search focus.

ExtraMediaGenre

The name of the Intent-extra used to define the genre.

ExtraMediaPlaylist

The name of the Intent-extra used to define the playlist.

ExtraMediaRadioChannel

The name of the Intent-extra used to define the radio channel.

ExtraMediaTitle

The name of the Intent-extra used to define the song title

ExtraOutput

The name of the Intent-extra used to indicate a content resolver Uri to be used to store the requested image or video.

ExtraPickImagesAccentColor

The name of an optional intent-extra used to allow apps to specify the picker accent color.

ExtraPickImagesInOrder

The name of an optional intent-extra used to allow ordered selection of items.

ExtraPickImagesLaunchTab

The name of an optional intent-extra used to allow apps to specify the tab the picker should open with.

ExtraPickImagesMax

The name of an optional intent-extra used to allow multiple selection of items and constrain maximum number of items that can be returned by MediaStore#ACTION_PICK_IMAGES, action may still return nothing (0 items) if the user chooses to cancel.

ExtraScreenOrientation

The name of the Intent-extra used to control the orientation of a ViewImage or a MovieView.

ExtraShowActionIcons

The name of an Intent-extra used to control the UI of a ViewImage.

ExtraSizeLimit

Specify the maximum allowed size.

ExtraVideoQuality

The name of the Intent-extra used to control the quality of a recorded video.

IntentActionMediaPlayFromSearch

An intent to perform a search for music media and automatically play content from the result when possible.

IntentActionMediaSearch

Activity Action: Perform a search for media.

IntentActionMusicPlayer
Obsolete.

Activity Action: Launch a music player.

IntentActionStillImageCamera

The name of the Intent action used to launch a camera in still image mode.

IntentActionStillImageCameraSecure

The name of the Intent action used to launch a camera in still image mode for use when the device is secured (e.

IntentActionTextOpenFromSearch

An intent to perform a search for readable media and automatically play content from the result when possible.

IntentActionVideoCamera

The name of the Intent action used to launch a camera in video mode.

IntentActionVideoPlayFromSearch

An intent to perform a search for video media and automatically play content from the result when possible.

MatchDefault
Obsolete.

Value indicating that the default matching behavior should be used, as defined by the key documentation.

MatchExclude
Obsolete.

Value indicating that operations should exclude items matching the criteria defined by this key.

MatchInclude
Obsolete.

Value indicating that operations should include items matching the criteria defined by this key.

MatchOnly
Obsolete.

Value indicating that operations should only operate on items explicitly matching the criteria defined by this key.

MediaIgnoreFilename

Name of the file signaling the media scanner to ignore media in the containing directory and its subdirectories.

MediaScannerVolume

Name of current volume being scanned by the media scanner.

MetaDataReviewGalleryPrewarmService

Name under which an activity handling #ACTION_REVIEW or #ACTION_REVIEW_SECURE publishes the service name for its prewarm service.

MetaDataStillImageCameraPrewarmService

Name under which an activity handling #INTENT_ACTION_STILL_IMAGE_CAMERA or #INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE publishes the service name for its prewarm service.

PickImagesTabAlbums
Obsolete.

One of the permitted values for MediaStore#EXTRA_PICK_IMAGES_LAUNCH_TAB to open the picker with albums tab.

PickImagesTabImages
Obsolete.

One of the permitted values for MediaStore#EXTRA_PICK_IMAGES_LAUNCH_TAB to open the picker with photos tab.

QueryArgIncludeRecentlyUnmountedVolumes

Flag that requests ContentResolver#query to include content from recently unmounted volumes.

QueryArgLatestSelectionOnly

Flag that indicates if only the latest selection in the photoPicker for the calling app should be returned.

QueryArgMatchFavorite

Specify how MediaColumns#IS_FAVORITE items should be filtered when performing a MediaStore operation.

QueryArgMatchPending

Specify how MediaColumns#IS_PENDING items should be filtered when performing a MediaStore operation.

QueryArgMatchTrashed

Specify how MediaColumns#IS_TRASHED items should be filtered when performing a MediaStore operation.

QueryArgRelatedUri

Specify a Uri that is "related" to the current operation being performed.

UnknownString

The string that is used when a media attribute is not known.

VolumeExternal

Synthetic volume name that provides a view of all content across the "external" storage of the device.

VolumeExternalPrimary

Specific volume name that represents the primary external storage device at Environment#getExternalStorageDirectory().

VolumeInternal

Synthetic volume name that provides a view of all content across the "internal" storage of the device.

Properties

AuthorityUri

A content:// style uri to the authority for the media provider

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MediaScannerUri

Uri for querying the state of the media scanner.

PeerReference (Inherited from Object)
PickImagesMaxLimit

The maximum limit for the number of items that can be selected using MediaStore#ACTION_PICK_IMAGES when launched in multiple selection mode.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

CanManageMedia(Context)

Returns whether the calling app is granted android.Manifest.permission#MANAGE_MEDIA or not.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateDeleteRequest(ContentResolver, ICollection<Uri>)

Create a PendingIntent that will prompt the user to permanently delete the requested media items.

CreateFavoriteRequest(ContentResolver, ICollection<Uri>, Boolean)

Create a PendingIntent that will prompt the user to favorite the requested media items.

CreateTrashRequest(ContentResolver, ICollection<Uri>, Boolean)

Create a PendingIntent that will prompt the user to trash the requested media items.

CreateWriteRequest(ContentResolver, ICollection<Uri>)

Create a PendingIntent that will prompt the user to grant your app write access for the requested media items.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetDocumentUri(Context, Uri)

Return a DocumentsProvider Uri that is an equivalent to the given MediaStore Uri.

GetExternalVolumeNames(Context)

Return list of all specific volume names that make up #VOLUME_EXTERNAL.

GetGeneration(Context, String)

Return the latest generation value for the given volume.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetMediaUri(Context, Uri)

Return a MediaStore Uri that is an equivalent to the given DocumentsProvider Uri.

GetOriginalMediaFormatFileDescriptor(Context, ParcelFileDescriptor)

Returns ParcelFileDescriptor representing the original media file format for fileDescriptor.

GetRecentExternalVolumeNames(Context)

Return list of all recent volume names that have been part of #VOLUME_EXTERNAL.

GetRedactedUri(ContentResolver, IList<Uri>)

Returns a list of EXIF redacted version of uris i.

GetRedactedUri(ContentResolver, Uri)

Returns an EXIF redacted version of uri i.

GetRequireOriginal(Uri)

Return if the caller requires the original file contents when calling ContentResolver#openFileDescriptor(Uri, String).

GetVersion(Context, String)

Return an opaque version string describing the MediaStore state.

GetVersion(Context)

Return an opaque version string describing the MediaStore state.

GetVolumeName(Uri)

Return the volume name that the given Uri references.

IsCurrentCloudMediaProviderAuthority(ContentResolver, String)

Returns true if and only if the caller with authority is the currently enabled CloudMediaProvider.

IsCurrentSystemGallery(ContentResolver, Int32, String)

Returns true if the given application is the current system gallery of the device.

IsSupportedCloudMediaProviderAuthority(ContentResolver, String)

Returns true if and only if the caller with authority is a supported CloudMediaProvider.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
NotifyCloudMediaChangedEvent(ContentResolver, String, String)

Notifies the OS about a cloud media event requiring a full or incremental media collection sync for the currently enabled cloud provider, authority.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetIncludePending(Uri)

Update the given Uri to also include any pending media items from calls such as ContentResolver#query(Uri, String[], Bundle, CancellationSignal).

SetRequireOriginal(Uri)

Update the given Uri to indicate that the caller requires the original file contents when calling ContentResolver#openFileDescriptor(Uri, String).

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to