I’m starting to develop an application for Google Android and heavily relying on a web API that can deliver data in a restful way via json or xml. I now have to decide which library to choose.
I saw that google includes org.json classes in the API but haven’t tested them yet.
How are your experiences? What library/API should I use and why?
If you’re mostly aiming for an internal API that is simply a link between servers you control and a client you’re creating, I’d highly recommend JSON – it’s far more concise in most cases, thus minimizing the data transfer necessary.
Parsing JSON with org.json is as straightforward as passing the JSON string to the constructor of JSONObject, and then using the appropriate type get-methods on each of your expected attributes.