I am writing a pretty Android application that will need to cache many different images ranging in size from 48x48 to 500x500 pixels. These images are retrieved over the network from several different sources (think: the user selects a source, looks at a bunch of images, changes the source, looks at a bunch of images, etc.). I would like to implement caching for these images, since I do not want to hit HTTP if someone throws some images that they already saw. Obviously, memory usage is quite important, so where EhCache comes in, since it offers many different options for limiting the cache, expanding it to disk, etc.
Is this the right / best way to cache these images? I noticed that the entire application cache on disk is enough for the SD card, but I would like to avoid this, if possible, for speed / convenience.
source
share