Skip to content Skip to sidebar Skip to footer

How To Parse Xml Data From Httpresponse In Android

i have made an activity in android,in that i have made a multipart entity request using HttpPost,Now i am getting successfull respose also.but thing is i dont know how to get those

Solution 1:

I got my answer by my way.Hello all for your responses but i got myy question solved by my way ,Actually all are telling me about different parsing but i want to know about the parsing from HTTP RESPONSE,So i have got my solution,here it is: http://www.java2s.com/Code/Android/Development/getCharacterDataFromElement.htm

Thanks for this useful post.

Solution 2:

            String xml="<yourxml></yourxml>"DefaultHttpClienthttpClient=newDefaultHttpClient();
            HttpPosthttpPost=newHttpPost(url);
            httpPost.setHeader("Content-Type", "application/xml");

            StringEntityentity=newStringEntity(xml);
            httpPost.setEntity(entity);

            HttpResponsehttpResponse= httpClient.execute(httpPost);
            HttpEntityhttpEntity= httpResponse.getEntity();
            xml = EntityUtils.toString(httpEntity);

Post a Comment for "How To Parse Xml Data From Httpresponse In Android"