Questions tagged [android-lru-cache]

LruCache holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head of a queue. When a value is added to a full cache, the value at the end of that queue is evicted and may become eligible for garbage collection.

LruCache holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head of a queue. When a value is added to a full cache, the value at the end of that queue is evicted and may become eligible for garbage collection.

109 questions
0
votes
2 answers

How to disable ActiveAndroid LruCache

Does anyone know how to disable ActiveAndroid default behavior of caching object models in LruCache? I want to disable entirely from my project. I have been able to clear the cache manually using Cache.clear(); but I need to keep doing it every…
velval
  • 3,072
  • 36
  • 45
0
votes
1 answer

JakeWharton's DiskLruCache automatically getting cleared

Im using Picasso and okhttp to download and cache images onto the disk. Im using the below code snippet to set a cache of 10MB to the okhttp client and using it for Picasso. File folder = new File(context.getCacheDir(),"HomePageCache"); if…
0
votes
1 answer

Android - Image GridView gallery with LruCache - images keep changing

I wrote this adapter class based on examples of LruCache usage. The problem I encountered is the following: If I do a fast swipe and the GridView scrolls really far down or up, (where the bitmaps are not yet cached) the images are drawn with the…
Anonymous
  • 4,470
  • 3
  • 36
  • 67
0
votes
1 answer

Is Android sdcard minimum file size always 4kb?

I am using a DiskLruCache to store around 70k files. These files are really small, half of them are not even 13 bytes each. However each file size is at least 4kb in disk because I assume that's the minimum block size. Therefore when I set a maxSize…
Héctor Júdez Sapena
  • 5,329
  • 3
  • 23
  • 31
0
votes
1 answer

Getting current memory used in LRUCache Android

For testing I want to see how many kB / MB are currently in use in my LRU Cache. I have the total size set to 4096. Is there a function like: public LruCache
Greg Peckory
  • 7,700
  • 21
  • 67
  • 114
0
votes
1 answer

Implementing LruCache for caching bitmap images

In my application I am fetching a feed from Internet. feed contains some text information and image. I have to store images in LruCache, for that I have referred Google developer website and implemented as shown in there. this implementation works…
droidev
  • 7,352
  • 11
  • 62
  • 94
0
votes
1 answer

How to use RoboSpice cache types

Note: this is general question of person new to caching mechanisms on Android. Why RS uses LRU caching in FlickrSpiceService sample? There is LruCacheBitmapObjectPersister: @Override public CacheManager createCacheManager(Application application)…
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
0
votes
1 answer

LruCache returning wrong bitmaps for specified key

I am very new to Android development. I am running into issues getting the correct bitmap from my LruBitmapCache. I use the UUID to generate a unique Id, I don't use a URL because I am generating the bitmap on a canvas. (I'm copying…
anpatel
  • 1,952
  • 4
  • 19
  • 36
0
votes
1 answer

Unable to reuse fragment for usage of LruCache

I'm using Google's example for caching bitmap across config changes, almost line-by-line: http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html#config-changes I am calling addBitmapToMemoryCache when a field is updated, which is…
Yunyu L.
  • 715
  • 9
  • 22
0
votes
1 answer

Preparing LruCache in Appwidget

i have an appwidget which starts an activity as user clicks it. In my Activity i have a gridview containing relatively small Drawables(Images, because drawable could be mor than just Images) but user can size them. I noticed that it takes too Long…
MMike
  • 598
  • 3
  • 23
0
votes
0 answers

How to create sub directory in DiskLruCache?

I'm using DiskLruCache in my project. It works great but I would like to know if it's possible to create sub directories under the root cache directory. DiskLruCache is a popular project on https://github.com/JakeWharton/DiskLruCache For…
0
votes
1 answer

How to convert URLs to bitmaps, store them in cache, and display in Listview?

I'm not asking for code, I just need some guidance on approaching a problem. I'm new to Android and I'm doing a small project, where I parse JSON from Google Images API to get the url links of images of a certain keyword. I am up to the point where…
0
votes
1 answer

Volley DiskBasedCache throws FileNotFoundException

I'm using BitmapLRUCache by Trey Robinson for image caching in my Android app. It's an implementation of LRU cache for Volley as it doesn't provide any image caching by itself. Though it does use DiskBasedCache for caching HTTP requests. Now coming…
Vibin
  • 843
  • 6
  • 18
0
votes
1 answer

ListView images and using convertView

I'm loading images in a ListView and am using the convertView to add new items. I am finding that when I scroll down quickly, the images from a few screens up are displayed before the current ones.. in the getView I am instantiating an AsyncTask.…
Tom McFarlin
  • 829
  • 1
  • 9
  • 24
0
votes
1 answer

Bitmaps are being saved to LruCache but they are not obtainable

Im caching my Bitmaps in GridView to LruCache. I made manager for this, see below: private LruCache mMemoryCache; public LruCacheManager(){ init(); } private void init(){ // Get max available VM memory, exceeding this…
Vojtěch Pešek
  • 1,070
  • 8
  • 25