Mark Zajac

Mark Zajac

  • 1.9k
  • 3
  • 135

SQLite Database Images

May 31 2020 11:46 AM
I read Amir Ali's article on retrieving drawable images and storing them in a SQLite database, but the code was for only a single image.
 
In the app I'm currently developing, I need to display several images at once, plus then be able to display several new images on the next screen. With roughly 400 images in total to display.
 
I have my Database Table created with data type "BLOB" for the images, but in the table, how do I reference the specific images to go in place?
 
In the article there is the code:
  1. img1 = c.getBlob(c.getColumnIndex("image"));  
  2. ...  
  3. Bitmap b1 = BitmapFactory.decodeByteArray(img1, 0, img1.length);  
  4. imageView.setImageBitmap(b1);  
Would I need to do that for every image and specifically put them in the table, or is there another way to reference them?
Thank you in advance for your assistance with my problem.

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)