Search code examples
androidimageperformanceencoding

Which method should I use to store and retrive images for an android application?


I am developing an application that requires me to retrieve multiple images from a Cache database and then display them on an Application.

At the moment i write the images to binary array's and then convert them to bitmap images on the application, but the Base64 string is about 30% larger that the actual image.

What encoding method should i use to reduce the overhead involved in storing these images?


Solution

  • You can store the images in the SDCard, in the device cache, or in a database. Not sure which you mean but here are some guides.

    This post explains how to store an image in any location on the sdcard: Save bitmap to location

    This one explains how to store in the device cache partition: Android, Saving and loading a bitmap in cache from different activities

    And this guide explains saving and retrieving bitmaps to/from a database.