-1

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

user3423477
  • 1
  • 1
  • 1
  • Check the Android tutorials about data storage. – m0skit0 Mar 15 '14 at 15:39
  • pls refer on this link [insert image on database][1] [1]: http://stackoverflow.com/questions/11790104/how-to-storebitmap-image-and-retrieve-image-from-sqlite-database-in-android – nEwbie Mar 15 '14 at 15:42

2 Answers2

0

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.

Community
  • 1
  • 1
Kunu
  • 5,078
  • 6
  • 33
  • 61
0

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.

Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95