Skip to content Skip to sidebar Skip to footer

How To Parse Json Using Gson

My Json response is something as below and confused how to parse it using GSON. Please have look on the following and guide me how i can parse it using GSON. { 'GetMICSDataResult

Solution 1:

Gson gson = new Gson();
YourClass class = gson.fromJson(jsonInString, YourClass.class);

Solution 2:

There is easy way to do that. Just use POJO generator http://www.jsonschema2pojo.org/ it will give you plain object with necessary annotations. also you can use Json formatter to validate your json https://jsonformatter.curiousconcept.com/ - the JSON you posted is invalid.


Post a Comment for "How To Parse Json Using Gson"