Monday, August 15, 2011

[android-developers] Adapting ImageDownloader enhancements to my app

Right now, I'm trying to modify ImageDownloader (http://
code.google.com/p/android-imagedownloader/source/browse/trunk/src/com/
example/android/imagedownloader/ImageDownloader.java
) so I can
implement a couple of enhancements particular to my app:

First, I am going to adapt the code to utilize hard and soft HashMaps
for a few different types of bitmaps for different aspects of my app
called from my singleton cache object. In other words, I will add a
constructor that will specify the type of image that I want to cache
(defined by a pre-determined State ID), that way, my cache object only
saves to and loads from those particular HashMaps for that type of
Bitmap I want to download. I am wondering whether I should just create
pairs of hard and soft hashmaps like the class for every type of
Bitmap I need to cache separately, or whether I should just create one
soft hashmap that the other hard ones dump their old images into?

Second, since I want to incorporate caching to either cache or SD card
(via flag from constructor), would it make sense that it be the last
check it performs in getBitmapFromCache, and if it does recover the
image from SD, do I have to add it back to the hard cache?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment