Android sample code "BitmapFun". Please check "Displaying Bitmaps Efficiently" chapter.