[android-developers] Insights for using query() and MediaStore.Audio.Albums
Hello,
I´ve been trying to figure a way out to search MediaStore.Audio.Albums
and MediaStore.Audio.Media to retrieve onlly albums from mp3 files.
I can list all albums and retrieve their songs but can´t filter which
albums have mp3s and which don't have.
Listing albums (all registered albums with audio files of any
extension):
String[] cols = new String[] {
MediaStore.Audio.Albums._ID,
MediaStore.Audio.Albums.ARTIST,
MediaStore.Audio.Albums.ALBUM,
MediaStore.Audio.Albums.NUMBER_OF_SONGS
};
Uri uriExternal =
MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Uri uriInternal =
MediaStore.Audio.Albums.INTERNAL_CONTENT_URI;
Cursor externalCursor =
getContentResolver().query(uriExternal, cols, null, null,
MediaStore.Audio.Albums.ARTIST + ", " +
MediaStore.Audio.Albums.ALBUM);
Cursor internalCursor =
getContentResolver().query(uriInternal, cols, null, null,
MediaStore.Audio.Albums.ARTIST + ", " +
MediaStore.Audio.Albums.ALBUM);
Can I archive the results I want using getContentResolver().query() or
do I need to run a SQL rougth command?
Using getContentResolver().query() I couldn´t figure out a way to
apply WHERE
clause or also search DISTINCT MediaStore.Audio.Media.ALBUM filtering
MediaStore.Audio.Media.DATA
Thanks for your help,
Gabriel Simões
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home