I have a huge JSON file to parse in my Android app.
I suppose it is too big to parse it, probably the memory won’t be enough. I usually parse just small file with GSON lib.
Is there a best practice for that? Or, do you suggest something to work it out?
Any suggestions is well appreciated.
You’re definitely going to need to use a streaming parser like JsonReader. It’s available both in Gson (link) and in Android 3.0+ (link). You should use
skipValue()aggressively since that avoids allocating objects that you aren’t going to use.