Android Save images to SQLite or SDCard or memory

I need to fetch images and some other data from server and then display it in the List. But as the number of records can be pretty large so I am not sure if I should save images to SQLite database or save it to SDCard or save those to memory.

Thanks, nil


Always make a habit of saving images path to database. For a list view, be sure just to use those image's thumbnail. This will help you in fast loading of these images in list.

 long selectedImageUri = ContentUris.parseId(Uri.parse(anniEntry.getUri()));
 Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(
                    mContext.getContentResolver(), selectedImageUri,MediaStore.Images.Thumbnails.MICRO_KIND,
                    null );

Here anniEntry.getUri() is the image uri.Now,put it in second code.U can get micro or mini thumbnail according to requirement


It's generally considered bad form to save binary data like an image in a database. In most cases, for some technical reasons, it will actually end up damaging the performance of your database. Instead, save the images you want to cache to the SD card and just store the filepath of those images in the database.