1

I get album arts by getting the album ids from the MediaStore column ALBUM_ID and then load them in Glide like this.

This code works fine but i would like to know what the hardcoded sArtworkUri with value content://media/external/audio/albumart comes from? Is this a reliable way of loading these album arts and is this value the same across all Android devices?

Code

Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart");
Uri albumArtUri = ContentUris.withAppendedId(sArtworkUri, albumIds.get(position));

GlideApp.with(context)
        .load(albumArtUri)
        .error(myImageList[randomNumber])
        .dontAnimate()
        .override(250,250)
        .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
        .into(holder.albumPageIv);
Vince VD
  • 1,506
  • 17
  • 38

1 Answers1

0

I can't tell you if there is a more reliable way but looking around it seems google uses it in Media Provider

public class MediaProvider extends ContentProvider {
    private static final Uri MEDIA_URI = Uri.parse("content://media");
    private static final Uri ALBUMART_URI = Uri.parse("content://media/external/audio/albumart");
pi-rhoman
  • 1
  • 2