Parsing The Xml Response In An Android Application
I want to Parse the XML Response in my Application using a SAX PArser, I don't know how to do that, So Can anybody please giude me to the right path. An example with a little codin
Solution 1:
try {
HttpClient client = new DefaultHttpClient();
String getURL = <URL>;
HttpGet get = new HttpGet(getURL);
HttpResponse responseGet = client.execute(get);
mResEntityGet = responseGet.getEntity();
if (mResEntityGet != null) {
//do something with the response
content = EntityUtils.toString(mResEntityGet);
}
} catch (Exception e) {
e.printStackTrace();
}
"content" will be the string of XML format, parse it using XML pull parser.
Post a Comment for "Parsing The Xml Response In An Android Application"