First time Java programmer. I’m wondering what my options are for loading XML on the Android platform (java). There are few docs/demos on connectivity and data loading out there (AFAIK). I need to sign a request with basic authentication and then GET/POST/PUT/DELETE to a URL which will return application/xml content-type. Basically I need to emulate this type of cURL request in Java:
curl -H 'Content-type: application/xml' -H 'Accept: application/xml' \
-u '{account}/{username}:{apikey}' https://mywebsite.com
Should I just use the HttpClient in org.apache or is there a better solution? Once I’ve loaded an XML response from my API, what is the recommeded parser for Android. There seems to be so many parsers for Java, I’m completely overwhelmed.
Certainly use HTTPClient, it should work on Android and it is so much easier to make the calls than writing one yourself… here’s an example:-