How do we remove the ListView with images from the SQLite database?



  • Android has a SQLIte database that stores data in four columns, like: "id," https://example.com/dataimage/136.970.jpg ", "text1", "text2." Naturally, the data in each line belong to each other. We need to get a listView from these data so that every item can contain a picture of it from the column where the picture's address is indicated, like, " https://example.com/dataimage/136.970.jpg "

    Getting out of SQLite cursor and collecting an adapter text1 and text2 is easy, but what about the pictures?

    The address of the pictures, as well as text1 and text2, I get from json, dissolving his AsyncTask and recording in SQLite.

    Please just tell me where to find and how easy it is. Thank you.



  • You need one of the library to download and display pictures from the network. Like UIL or Picasso

    In the first case, the code will be:

    ImageLoader imageLoader = ImageLoader.getInstance(); // Get singleton instance
    imageLoader.displayImage(imageUri, imageView);
    

    The second is:

    Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2