I'm working on an application that shows a list of images (from a URL) and some text in a ListView. It looks like that (+'s are images):
-------------------------
| +++ some text |
| +++ some text |
-------------------------
| +++ some text |
| +++ some text |
-------------------------
| +++ some text |
| +++ some text |
-------------------------
| +++ some text |
| +++ some text |
-------------------------
I'm getting the URLs and the text by parsing a string that contains the source code of a certain web page, and I'm getting that source string using a HttpGet request.
So this application needs to download a web page, parse it and then download some images and display it in a list.
I'm not sure about the last part. I managed to download and parse html source code using asynctask, but the rest is a bit tricky for me.
How can I do that?
(I hope this was clear enough)
Edit:
I'll try to be more accurate now :) I've created an object called MediaObject, which has 3 strings (image URL, song name and song's artist). Iv'e also written a function that gets a string (that holds an html source code), extracts from it the URLs and the names and returns an array of MediaObject objects.
At this moment I display only 1 song, using 2 asynctasks: 1) To get the html source code, then get a MediaObject object and display the song/artist name in a textview. 2) Download the image and display it in a imageview.
It works fine, but only for 1 MediaObject. I want to display in a listview several songs (using several MediaObject objects).
The problem is that I'm not sure how to do that. Should I use several asynctasks? new asynctask for every image?