How to parse data >50mb .There is zip inside json file which is more than 50 mb.please help me to solve this problem i will get out of memory error while parsing.
-
Why would you want to parse >50mb json file ? – Rahul Gupta Feb 06 '15 at 06:00
-
http://stackoverflow.com/questions/11104171/android-parsing-large-json-file – Deshan Feb 06 '15 at 06:01
1 Answers
You should use Gson or Jackson for this purpose. note.. I have no clue how but you would do great with a pointer.
Loading a 50 mb file all at once would be a problem to the device due to the following :
Large file ... Lots of time to load , affects the users expression towards your app if its public.
Parsing , a 50 mb json file is nothing but 50 mb of arrays . It might not be a good idea to parse it all at once. Note.. Make sure you google on ways to avoid garbage collection.
Now ,
Why Gson or Jackson ?
Well , normally if you would parse a json file it would load it all at once taking a lot of time as well as affecting the memory consumption.
With the help of these , you can load off only a few items in the json file at a time..this is called json streaming.
For example you can use it while loading a product list , loading off a few products into the list as you scroll .

- 566
- 1
- 6
- 19