java - android cache > internal storage vs. object cache -
I need to display cache images from the web (up to only 5 or 100) and in the list view. The cache can be cleared if the user selects a line in the list. I used to take a look at some examples Some external storage uses some internal and external use Some objects.
Then internal storage (via getCacheDir ()) and the benefits of object cache / What are the losses (some characters like weak hasham or hashmap; string, soft reference; liey; dry & gt;)?
One problem with softreferences is that they can be very fast (gc'ed). What about Android's internal storage? Reference Software "These files will be those that are deleted earlier when the device goes down on storage."
Does it make any difference in using this object cache or temporary internal storage? There should be a little bit faster than the object cache
There are some differences between the two: < Ul>
Now seeing those differences, they are completely exclusive Not many of us are implementing multi layer caching, especially related to image loading. Here are the steps given:
- If the image is not cached, get it from the URL and cache it in the first level cache, which is also a soft reference / vichshap or limited cache
- Then we apply removeEldestEntry () to LinkedHashMap when we kill the hard cache capability, we take things into the secondary cache, which is the internal storage. To use this method, you do not need to refrave the image from the URL + it is still faster and it frees up your memory
- We use the LRU internally Cleanup algorithm on time on the background for storage. You should not rely on Android to clean it for yourself.
We have cached multiple layers of a common component and we have used many of our projects for our customers, due to the L1, L2 cache in the computer architecture, this technology is much more is.
Comments
Post a Comment