-2

I'd like to be able to programmatically work with Images, ImageViews, Drawables, and SQLite blobs (byte arrays). I inevitably want to be able to have a program that lets me acquire images from the Gallery app or something similar (ie camera), and then place them in a gallery construct within my app and work with them from there. Storing them in SQLite database's as needed.

I haven't come across anything that works. Much of it is deprecated. I have a simple project that is working with text in a SQLite database, and am now trying images.

If you can show or send me someplace that shows how to work with these constructs that would be great. Though to be more specific for this thread I'll state a few things I'd like to do:

  • Converting Drawables to ImageViews and converting Drawables to SQLite blobs.
  • Acquiring images from outside the program and placing them in the Drawables section.
  • Best constructs for working with images.

Thanks,

Evan Sevy
  • 659
  • 1
  • 13
  • 25

3 Answers3

2

convert a image to byte[] and easy to store SQlite db

Ramesh Prajapati
  • 654
  • 6
  • 10
-1

Instead of saving image as blob, save the image url. Or save it in external file in sd card or phone memory.

To save it in a link, When the user selects an image from gallery. Call the upload image function ( it can be a BoundService ). You can find it by googling it. When the upload image is successfull, ull get the image url in Json.

Just save that image link in your sqlite database.

Hope it helps.

Vishal Puri
  • 823
  • 8
  • 15
-1

Don't store images in SQLite, instead of saving images save their path into SQLite, and later you can load image from their path.

and if you are loading images from web then you can use Universal Image Loader. It will display and store images in device memory and you can load images offline anytime with same url.

Learn Pain Less
  • 2,274
  • 1
  • 17
  • 24