What is the difference between gson and json?

Rishabh Maurya picture Rishabh Maurya · Nov 2, 2016 · Viewed 25k times · Source

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 .

Answer

bslawski picture bslawski · Nov 2, 2016

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.