Saving an Image to the Database

1

Hello, I was wondering if you can save an image in the database and show it in a listview. If you have how you wanted to know or if you can not save an image in the database, how can I do to call a different image for each row ....

    
asked by anonymous 03.07.2017 / 22:04

1 answer

-1

It is possible to save images to the database by converting them to an array of bytes ( byte[] ) and storing them as a BLOB in the database, but from experience it is not performative, since this constant conversion / of the ListView adapter, left the UI extremely slow when I implemented it that way.

Ideally, you should save the reference of the images to the bank and then use those references to access the images saved locally. Libraries such as Picasso or Glide already make a local cache.

    
03.07.2017 / 22:49