Take the 2-minute tour ×

Kind of new to caching of bitmap for android. Would like to ask a few questions. Do you guys have sample code of caching an image and retriving an image from cache. How do the codes know once the cache is being overridden?

share|improve this question
Search for LazyAdapter. –  Mighter Nov 14 '11 at 21:13
And what kind of cache is it you want? A memory cache for decoded images or a file cache for downloaded images? (Or parhaps a combo of them both?) –  H9kDroid Nov 14 '11 at 21:18
wow? Whats the different between a memory cache and a file cache? i'm using mainly for caching image downloaded from web so that i can pass around activity –  ericlee Nov 14 '11 at 22:00
If you store a file as a file cache it will be written on nand memory and it will be stored if you close application :), but that will not happen for a memory cache, since all the objects are marked for garbage collection if app is closed –  Arkde Nov 14 '11 at 22:09
Hey man thanks! Do you have any tutorial for memory cache? Most likely will use memory cache as it should only be stored on runtime :). If user reopen the bitmap might have been changed –  ericlee Nov 15 '11 at 8:41

2 Answers 2

up vote 1 down vote accepted

There is a question similar to this: give it a look here Android image caching . You will see there an elegant method to solve your problem :)

share|improve this answer

You can check this link. If you go to the source code you can see how to create a cache.

share|improve this answer

Your Answer


