I want to parse the images in the xml file. i am able to parse the text but how to parse the images and display image corresponding to that text in list view.Image and Text should be in one row. My Xml file sample is below
<tv>
<channel id="0240.TEN ACTION.in">
<display-name>0: TEN ACTION+</display-name>
<thumb_url>http://localhost/rg.jpeg</thumb_url>
</channel>
<channel id="2130.ENTER 10.in">
<display-name>0: ENTER 10</display-name>
<thumb_url>http://localhost/rg.jpeg</thumb_url>
</channel>
</tv>
Try following code:
First you need to get the image path from xml like any other attribute of xml and then pass that URL to this function.
Nothing too complicated – simply create a URL object using the “src” string (i.e.
String src = “http://thinkandroid.wordpress.com”), connect to it, and use Android’s BitmapFactory class to decode the input stream. The result should be your desired Bitmap object!