I have a JSON object that looks like this
{ \"foo\":{ \"bar\":\"bar\", \"echo\":\"echo\" } }
But then my Java object looks
You have to write a model class with all the variables and then you can use
Gson gson=new Gson(); ClassName objectName=gson.fromJson(yourJsonObject,ClassName.class);
Here objectName contains your json
objectName