1

I have a huge json data which i got from a http , i tired the JSON Reader , and passing a string to the JSON object, both ways worked but i prefred the JSON Reader which takse an Input stream , because the string buffer for some point of time won't be able to hold all the json data. My problem is that JSON reader is avaiable for API 11 , and i'm developing my android application to work on API 8 and higer, is there away to use the JSON reader in API 8? or is there another JSON parser which may take an input stream to parse the data?

http://developer.android.com/reference/android/util/JsonReader.html

Reham
  • 1,916
  • 6
  • 21
  • 45
  • for large json i'm using jackson library which have [streaming api](http://wiki.fasterxml.com/JacksonInFiveMinutes#Streaming_API_Example) – Selvin Jun 28 '13 at 11:11
  • 1
    You may want [`GSON with STREAMING`](https://sites.google.com/site/gson/streaming). Gson includes streaming from version 1.6 with the addition of the `JsonReader` and `JsonWriter` classes in the GSON Library... – Writwick Jun 28 '13 at 11:37
  • May be this [LINK](http://tech.xtremelabs.com/parsing-json-data-efficiently-on-android-jsonreader/) will help you. – garmax1 Aug 26 '13 at 19:42

1 Answers1

1

You could just include the JsonReader source code from the Android project into your app's source - there's only a handful of related classes, and they're fairly simple & self-contained, so it should be too much trouble to add.

Here's a good place to find the code...

Mark Beaton
  • 2,657
  • 3
  • 23
  • 33