Reputation: 1573
I'm working on a music player app for android. So far I'm going good. No errors and all's working just fine.
The thing I want to ask is how to display album arts for all the albums quickly without consuming too much memory or other resources.
Right now, I'm just fetching the album art Uri from "MediaStore.Audio.AlbumColumns.ALBUM_ART" and using "ImageView.setImageUri(uri)" method to display the album cover for each album. What happens is that it fetches the images as they are and consumes a lot of memory and also slows the app down. I have looked into many places but couldn't find any proper documentation or tutorial.
So please guide me to achieve this in a better way. Any help would be really appreciated. I'm working for android level above ICS. If anymore info is needed, please let me know.
Upvotes: 2
Views: 965
Reputation: 10338
You can lazyload the images. The easiest way to do it would be to use external library like universal image loader. I have used it in my project and it was awsome. Other library are also available have a look at others like picasso though I havenot tested it yet.
Upvotes: 1