K
K
Kyborg20112011-03-01 17:29:40
Android
Kyborg2011, 2011-03-01 17:29:40

Getting Music Authors in Android

What methods can be used to get a list of all music authors (as in a standard player - a list of performers), when creating a player for Android?

PS I guess that it is implemented using MediaStore, but I just can’t figure it out with it ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Infernal, 2011-03-01
@Infernal

Cursor cursor = managedQuery(MediaStore.Audio.Artists, 
        		new String[] {MediaStore.Audio.ArtistColumns.ARTIST}, 
        		null, null, null);
                  
if (cursor.moveToFirst()) {
  int artistIndex = 
              cursor.getColumnIndex(MediaStore.Audio.ArtistColumns.ARTIST);
  do {
    String artistName = cursor.getString(artistIndex);
  } while (cursor.moveToNext());
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question