I am trying to fetch all the albums from the device and displaying it. And it works fine. But I observed that the Artist for Album is showing differently in Play music . Is there any other way to get the artist other than the below code?
Uri uri = MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
String[] cols = new String[] {
MediaStore.Audio.Albums._ID,
MediaStore.Audio.Albums.ARTIST,
MediaStore.Audio.Albums.ALBUM,
MediaStore.Audio.Albums.ALBUM_ART
};
Cursor cursor = MusicUtils.query(this, uri,
cols, null, null, MediaStore.Audio.Albums.DEFAULT_SORT_ORDER);
mArtistIdx = cursor.getColumnIndexOrThrow(MediaStore.Audio.Albums.ARTIST);
String artistName = cursor.getString(mArtistIdx);