How to load images quickly on Android

Asked 2 years ago, Updated 2 years ago, 47 views

I'm developing an mp3 player application. Since there are over 100 songs, I load the album art when I print out the list of songs It's lagging a lot. Is there a quick way to load an image from RecyclerView?

image android

2022-09-22 12:49

1 Answers

Among Android open sources, there is an open source called Picasso. https://github.com/square/picasso This library helps you load images easily and simply. It's very simple to use.

in build.gradle compile 'com.squareup.picasso:picasso:2.5.2' Please add

Picasso.with(Context).load(Path,Uri,Resource id).placeholder(Path,Uri,Resource id).into(**ImageView) You can do it like this. In load, you can give the resource ID, file path, or uri Placeholder is an option, which allows you to display other images while loading the image.


2022-09-22 12:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.