I see word 'gson' at various places in books related to android , blogs etc. Is it similar to kml in any way or it is different .
-
2From Google: [What is the use of GSON?](https://www.google.co.uk/#q=What+is+the+use+of+GSON%3F) – Aurora0001 Nov 02 '16 at 18:58
-
6I certainly didn't downvote for the badge (I would much rather upvote good questions, and I can only vote so many times a day), but this question is trivially solved by searching yourself, and you are expected to put in some effort before asking (after all, people who answer do take their time to solve your problem). The downvote tooltip even says, "This question does not show any research effort; it is unclear or not useful". In my opinion, this question fits in that description. If you don't understand the answer on Google, ask a more specific question based on that. – Aurora0001 Nov 02 '16 at 19:05
-
2As I'm trying to explain, I didn't downvote your question for any reason other than my opinion that you haven't researched the question yourself. If you want people to spend 10-15 minutes or more writing a clear, well-researched answer to your question, ask a clear, well-researched question. It is just doing yourself a disservice if you expect others to do your work for you and give you the answer when you could get it so easily yourself. If you improve your question by showing what you've looked at so far, I will happily retract my downvote. – Aurora0001 Nov 02 '16 at 19:17
-
@RishabhMaurya Already did – litelite Jul 21 '17 at 13:35
-
@litelite Now I have asked the question separately . – Rishabh Maurya Jul 21 '17 at 13:37
5 Answers
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.

- 600
- 1
- 9
- 22
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.

- 53
- 1
- 4
GSON is a library that is used to convert serializable java objects to JSON and vice-versa .

- 1,448
- 3
- 22
- 40
GSON can use the Object definition to directly create an object of the desired type.
While JSONObject needs to be parsed manually.

- 437
- 4
- 12