I am working on an Android App and using Volley library. The response for some of the requests are in XML format. I searched for Android Volley tutorial on how to deal with XML, but can't seem to find.
The only option at this point for me is:
Here's the source of Volley: https://android.googlesource.com/platform/frameworks/volley/+/43950676303ff68b23a8b469d6a534ccd1e08cfc/src/com/android/volley/toolbox
I don't see any class dealing with XML Objects.
Any other advice. Help???
As someone posted in comment, it has been answered here:
Volley library for Android parse xml response?
Volley do not directly provide an XML Object. Your approach of taking the response as String and then inflating to XMLObject is the way I did it.
I made a Class for parsing XML Responses from Server (Combining GsonRequest with Simple). Here's the Class Code Snippet: SimpleXmlRequest
At first it takes the response from Server as String. Then, it uses Simple Serialization tool (http://simple.sourceforge.net/) to inflate the response to XML Object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With