0

I've been trying to parse a very complex JSON blob with several levels of nesting. The structure of the JSON returned by the server can change for every call.

I have written a recursive JSON parser using org.json, but the performance isn't great. I do know that JSONReader offers better performance and have been trying to write a module that parses this complex JSON recursively using JSONReader.

From what I see, JSONReader is better for streams where the structure of the JSON is known. Is it advisable to use this for JSON that can change continuously? The example in the Android docs (and other examples i found online) assumes that the JSON has a fixed structure.

sr09
  • 720
  • 5
  • 26
  • 1
    Simplest way is using Gson, but it may not be the fastest performance-wise – Rick Sanchez Mar 04 '15 at 21:41
  • I'm trying to avoid using third party libraries. I do know that Jackson and Gson are good options, but they also carry some overhead. – sr09 Mar 04 '15 at 23:53
  • @user3282164, yes you are right they might require a little work but they can finish a lot of work for you in single line of code. try to use custom class typs with Gson it will make your code easy and more flexible and readable as well. – Pankaj Nimgade Mar 05 '15 at 05:47

0 Answers0