2 Minutes To Code (β Version)

JSON and gson api - 2 minute tutorial

Overview of JSON and gson api

JSON or Javascript Object Notation is a way to write objects in simple text form. This notation is human readable, easily parseable and concise form of writing objects, hence is widely adopted.

The next few examples show how to get json text form of an object programatically and vice-versa.

For this we will be using the json apis from googgle which can be downloaded from Google Gson Version 2.2.2. The jar file gson-2.2.2.jar that you get from this link needs to be added to the classpath.