Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cover art on android

Tags:

android

I am developing a sort of media player for android. The question is how can i get the cover art of audio file on android. For example the default android media player shows album covers when listing albums, how can i get this artworks.

like image 923
Mojo Risin Avatar asked Dec 23 '09 18:12

Mojo Risin


1 Answers

Uri sArtworkUri = Uri.parse("content://media/external/audio/albumart"); Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id); ContentResolver res = context.getContentResolver(); InputStream in = res.openInputStream(uri); Bitmap artwork = BitmapFactory.decodeStream(in); 

More complete sample code can be found in Android Music player source here https://github.com/android/platform_packages_apps_music/blob/master/src/com/android/music/MusicUtils.java method getArtworkQuick.

like image 78
Fedor Avatar answered Nov 05 '22 02:11

Fedor