Benefits of GSON over normal JSON parse
android, gson, json, memory
Solution
GSON has been successfully used in several android apps that are in Google Play today. The benefit you get with GSON is that object mapping can save the time spent writing code. As for the implications on memory usage, you can use the fromJson() method call that takes a streaming JSONReader to minimize the String data that is kept in memory, failing which you can try to parse the json data using a JSONReader yourself.
Problem
The application I am working on is primarily based on manipulating JSON data obtained from the server. Traditional JSON parser extracts values, sets required POJOs and passes on to UI handler to render. This part is working well for now. I have heard of GSON library and run through its implementation steps. As per my understanding, it (GSON usage) requires the following. - JSON data in proper syntax. - Model class objects matching JSON response. - GSON injector or code snippet to fetch JSON from the server and feeds to GSON. The above approach sounds rather like object mapping. However, I am unaware about how efficient is GSON compared to old-fashioned JSON parsing; particularly with complex JSONs. And its implications on memory usage? What do you think?