I recently followed Googles Advice on Bitmap Caching in Android and added my own LruCache from the support library. The LruCache works best if the size of the images in bytes is known to the cache.
The problem ist the getByteCount for bitmaps is only available since Android API Level 11.
How would you guess the size of an bitmap in memory?
From the android.graphics.Bitmap source code:
Both
getRowBytes()andgetHeight()are since API Level 1, so you can implement your own owngetByteCount()for all versions of Android. At a glance, it appears thatgetByteCount()was only added for convenience.