/* Audio Play List */ Addfiletype ("m3u", file_type_m3u, "Audio/x-mpegurl"); Addfiletype ("PLS", File_type_pls, "Audio/x-scpls"); Addfiletype ("WPL", FILE_TYPE_WPL, "APPLICATION/VND.MS-WPL");Writes to the database after the scan is finished. Other applications are able to know when the scan operation begins and ends by receiving the action_media_scanner_started and action_media_scanner_finished intent emitted by the mediascannerservice. 2. Mediaprovider for the multimedia information stored in the database, Mediaprovider provides the interface for data access. Mediaprovider inherited ContentProvider, let's take a look at the data query interface: Cursor query (URI uri, string[] projection, String selection, Str Ing[] Selectionargs, String sortOrder); Uri: Indicates the name of the database to query, plus the name of the table, from the mediastore we can find the parameters of the corresponding information, please refer to the development documentation.
Projection: Specifies which columns in the database table are queried, and the corresponding information is included in the returned cursor. NULL returns all information.
Selection: Specifying query criteria
Selectionargs: Is there a parameter in selection? This symbol is where the actual value can be substituted for this question mark. What if selection this? , then this string array can be null.
SortOrder: Specifying the order in which query results are sorted
The following command returns information about all the music files on the external memory card:
cursor cursor = query (MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, NULL,
NULL, NULL, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
Get the album name of the song in the ID tag: MediaStore.Audio.Media.ALBUM
String album = cursor.getstring (Cursor.getcolumnindexorthrow (MediaStore.Audio.Media.ALBUM));
Please refer to the Mediastore class for other specific parameters.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.