android - how to store and retrieve multiple images in sqlite

I'm modifying this quiz app chuck quiz app i want to know how to store images because i need to display different image every question in that app. Anyone can help me? thanks in advance

Answers


You can store image as blob format in sqlite database.Convert your drawable to blob or your bitmap image to blob format and store it.

Check this link for converting drawable images to blob. You can refer to this example also.


A Simple answer would be why do you want to store the image in database rather storing Image in database.

It would be more efficient to store the path of the image in database and store the image in file systems

create a column and store the path in your app directory where only your files can be saved.


Note:

If the file size is large enough or the number of images are much then you can store it to SdCard or

if you are accessing the image you can save it to url.


Need Your Help

java.lang.IllegalStateException: System services not available to Activities before onCreate() When trying to store users location as a variable

java android google-maps system-services

I have created a distance calculator for my final year project. The calculator should display the users current location and then display a marker on the map when pressed. The distance will be disp...

How to save a new line in input stream? Java - Android

java android inputstream outputstream

I want to save text with InputStream from EditText while preserving new lines in the text.