1

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?

lopez.mikhael
  • 9,943
  • 19
  • 67
  • 110

3 Answers3

3

take a look at this one: https://code.google.com/p/google-gson/

It converts automatically JSON objects to native java classes.

Klawikowski
  • 605
  • 3
  • 11
2

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 ...

Community
  • 1
  • 1
gunar
  • 14,660
  • 7
  • 56
  • 87
0

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.

Mateusz Pryczkowski
  • 1,874
  • 1
  • 16
  • 20