Hello,
I´ve been trying to figure a way out to search MediaStore.Audio.Albums
and MediaStore.Audio.Media to retrieve a list of mp3 albums and
organize them in an expandablelistview.
In the end what I haven´t been able to do is to retrieve information
about existing albums with mp3 files. I can list all albums and
retrieve their songs but can´t filter which albums have mp3s and which
haven´t.
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);
Do I need to run a SQL or can I archive the results I need using
getContentResolver().query()? I couldn´t figure out a way to use 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en