I\'m requesting data from a server which returns data in the JSON format. Casting a HashMap into JSON when making the request wasn\'t hard at all but the other way seems to
Update for new Gson lib:
You now can parse nested Json to Map directly, but you should be aware in case you try to parse Json to Map type: it will raise exception. To fix this, just declare the result as LinkedTreeMap type. Example below:
String nestedJSON = "{"id":"1","message":"web_didload","content":{"success":1}};
Gson gson = new Gson();
LinkedTreeMap result = gson.fromJson(nestedJSON , LinkedTreeMap.class);