Videos
JSON is a data format that is human-readable and supported by a wide variety of languages. An example of JSON encoded data:
{
"name": "John",
"age": 27,
"interests": ["running", "guitar", "foreign movies"],
"favorites": {
"color": "blue",
"book": "Gödel, Escher, Bach: An Eternal Golden Braid",
},
}
GSON is a java API from Google that converts java objects to their JSON representations and vice-versa. Installation instructions and sample usage here.
Google Gson is a simple Java-based library to serialize Java objects to JSON and vice versa. It is an open-source library developed by Google.
The following points highlight why you should be using this library −
Standardized − Gson is a standardized library that is managed by Google.
Efficient − It is a reliable, fast, and efficient extension to the Java standard library. Optimized − The library is highly optimized.
Support Generics − It provides extensive support for generics.
Supports complex inner classes − It supports complex objects with deep inheritance hierarchies.