If you have album ID you get Album Image uri :-
final public static Uri sArtworkUri = Uri
.parse("content://media/external/audio/albumart");
Uri uri = ContentUris.withAppendedId(PlayerConstants.sArtworkUri,
listOfAlbums.get(position).getAlbumID());
And if you have a Image uri you can use any of the image loader Glide, Picaso, UIL to display images .
**OR**
you can write your own image loader
public Bitmap getAlbumart(Context context, Long album_id) {
Bitmap albumArtBitMap = null;
BitmapFactory.Options options = new BitmapFactory.Options();
try {
final Uri sArtworkUri = Uri
.parse("content://media/external/audio/albumart");
Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id);
ParcelFileDescriptor pfd = context.getContentResolver()
.openFileDescriptor(uri, "r");
if (pfd != null) {
FileDescriptor fd = pfd.getFileDescriptor();
albumArtBitMap = BitmapFactory.decodeFileDescriptor(fd, null,
options);
pfd = null;
fd = null;
}
} catch (Error ee) {
} catch (Exception e) {
}
if (null != albumArtBitMap) {
return albumArtBitMap;
}
return getDefaultAlbumArtEfficiently(context.getResources());
}
public Bitmap getDefaultAlbumArtEfficiently(Resources resource) {
if (defaultBitmapArt == null) {
defaultBitmapArt = decodeSampledBitmapFromResource(resource,
R.drawable.default_album_art, UtilFunctions
.getUtilFunctions().dpToPixels(85, resource),
UtilFunctions.getUtilFunctions().dpToPixels(85, resource));
}
return defaultBitmapArt;
}