Save images in the database and then show in a listview

Asked

Viewed 1,528 times

-4

I want to save images by sqllite and then display them for a listView, but I don’t know how to do it. Can someone help? No need to show lines of code I just want to know the logic I should follow or which classes to use.

  • Usually only the image path is saved in the database, not the image. You want to save the image yourself?

  • Has the field type blob, you can use to save the image as an array of bytes.

1 answer

3


I do not advise you to save the image directly in the data field but save the image in a folder within your application and copy and save the Uri(Path to image) in the Database the same way Whatsapp does with the images you receive from a conversation.

The procedure would be as follows: -Download Image know which Uri. Cool answer here :https://stackoverflow.com/questions/15549421/how-to-download-and-save-an-image-in-android -Keep Uri in the database. -At the time of uploading the data to the list, you get all the information including Uri. -Load the image by Uri using a lib : Picasso, Volley, Glide etc

Browser other questions tagged

You are not signed in. Login or sign up in order to post.