https://kotlinlang.org logo
Title
c

ClaudioVieira

02/17/2023, 11:16 AM
Hello, I need to cache images on my application and I was wondering what is the best way to do that. The application have to cache the images and load them if I don’t have internet and even if I close and open the app again. I saw some articles using Glide or Picasso, but I’m using Jetpack Compose so I think these frameworks won’t work properly. So I was trying to use DiskLruCache but is kinda complicate to understand how it works. Does somebody have some article or solution to help me? Thanks a lot!!
k

krzysztof

02/17/2023, 11:41 AM
Since this is a Compose question, you should it ask in #compose But to answer your question - you can use Glide with compose (here’s the doc on integration)
c

ClaudioVieira

02/17/2023, 12:26 PM
Thank you for the answer. I was thinking about Glide but as the images are on Firebase I can’t get them directly from URL because it needs login to download the images, and the Glide doc doesn’t show a way to load directly from a bitmap instead a URL. So I’m not sure if I can cache them. If you have any idea how can I handle it I would be thankful.
j

Jakub Syty

02/17/2023, 1:22 PM
And it works really great with compose
c

ClaudioVieira

02/17/2023, 10:00 PM
Thank you, it helped me too.