2

I am trying to figure out the right architecture for a list view that loads information from an http endpoint. My problem is that the information to be displayed has both text and image content. If I only load the text content the the UI is very responsive but if I also load the image content then it takes a few seconds for the list to be populated. I parse the content as it comes in and build up a list adapter but what I want to do is build up the list adapter incrementally so that the user sees the information as it becomes available instead of waiting until the last item is processed before any information is displayed. Currently I do everything with the help of AsyncTask so I'm aware of threads and how they can be helpful so I'd like to know how other people have worked around the issue of displaying list based information as quickly as possible.

David K.
  • 6,153
  • 10
  • 47
  • 78

2 Answers2

1

So this solution doesn't incrementally build the ListView but if the text information comes quickly as you mentioned I think it might help:

Lazy load of images in ListView

Basically this solution will place a stub image in the ImageView until the desired image is finished downloading.

Community
  • 1
  • 1
powerj1984
  • 2,216
  • 1
  • 22
  • 34
1

It is not only about loading images as far as i understand your question. Please look at "Implementing a Dynamically Loading Adapter (Endless List)" tutorial: http://codinglines.frankiv.me/post/14552677846/android-implementing-a-dynamically-loading-adapter

instanceMaster
  • 456
  • 3
  • 12