I am developing an app where I need to cache images such that I can retrieve them when the user is offline and they should also be accessible once the user closes and reopens the app.
I need something like
FirebaseFirestoreSettings.setPersistenceEnables(true)
My problem is that I can not find a proper way of doing it.
- I tried saving the pictures to LruCache but all the cached data gets deleted once the app is closed.
- I can save the pictures into a file and retrieve them but I don't want the user to have access to those pictures as some of them might be copyrighted.
- I could store the Bitmaps using DiskLruCache but I cannot find a tutorial explaining how it works and the article about it on the android developer site is not of any help.
Maybe `Glide is a solution but I could not retrieve the saved bitmap when I needed it.
Is there a correct or best way of doing it?