Search code examples
androidksoap2

Android Parser XML Data from .net webservice USING KSOAP2


I am working on a Android application that receives response from .Net Webservice as XML.

Sample XML:

<?xml version="1.0" encoding="utf-8" ?><NewDataSet>
<Table>
<Area> Area A </Area>
<code>100000</code>
</Table>
<Table>
<Area>Area B </Area>
<code>100001</code>
</Table>
</NewDataSet>

I need to parse this Xml into listview in next activity.

Can someone please guide me how to do this.

Thanks in Advance.


Solution

  • You can, for example, create a class ListViewElement and store each data in this class. When you got every ListViewElement, just store each of them in an ArrayList. Finally, you just have to write an ArrayAdapter to display your data.