I am trying to parse a JSON directly from a predefined object. The SimpleXML library can do this thing perfectly but for XML files.
Is it therefore a library that can do this on Android?
I am trying to parse a JSON directly from a predefined object. The SimpleXML library can do this thing perfectly but for XML files.
Is it therefore a library that can do this on Android?
take a look at this one: https://code.google.com/p/google-gson/
It converts automatically JSON objects to native java classes.
There are 2 main JSON parsers used on Android: Jackson and GSON. This article contains info on both. Personally, I prefer Jackson as according to test benchmarks, it's faster than GSON.
Also, this SO thread discusses the GSON performance. You might find it useful ...
Jackson is another kind of java library, that was designed to make 2-way conversions json<-> objects. Performance of this library is quite similar to gson.