My app is downloading image file from internet. To improve performance, I cache the bitmap in memory (both hard and soft cache). I do cache the image file in SD card as well.
Decoding image file from SD card takes noticeable time. I measured this line of code, it takes around 500 - 1800 milliseconds.
Bitmap bitmap = BitmapFactory.decodeFile(pathName, bitmapOptions);
Some facts
- Average actual image size is 600×600.
- Requested bitmap size is between 200X200 to 400×400
- Have used
bitmapOptions.inSampleSizeto scale the image
Can anyone suggest what is the better way to improve the performance of file decoding?
Thanks
You can cache the image in all formats you need and decode them.