MediaStore more or less an SQL database. There are many ways to request it. By album, by artist, by playlist, by song, etc. This will return the Cursor all songs, for example.
Cursor cursor = getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.TITLE + " ASC");
After that, you can get specific columns:
while (cursor.moveToNext()) { String title = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Media.TITLE));
source share