What is the best mechanism for saving key values ​​storage on android (with large values)

I want to use the quick keystore on an Android device, where the values ​​are bitmaps of images. The storage should be copied to disk and provide some caching while minimizing IO disk. Multithreaded access is desirable but not required.

I looked at Java Berkeley DB , which seems to meet the requirements. Are there other libraries that work better? Or does Berkeley DB work well on the Android platform?

I'm fine with a solution that requires one pair of keys and values ​​to be in memory, but storing a full pair of key and value values ​​can exceed the device’s memory size.

+6
source share
1 answer

I suggest file-based file-based caching, works well without overloading device memory. There is no need for any additional materials, esp DB will not be the optimal way for such needs.

here are some libs;
- https://github.com/commonsguy/cwac-cache (deprecated)
- https://github.com/wareninja/generic-store-for-android
PS stores key-value and processes optimized caching based on memory files

I used both of them, especially for image caching, and so far they work very well.

+4
source

Source: https://habr.com/ru/post/887130/


All Articles