I am not sure what i am missing here. All I am trying to read response and return boolean. Error I am getting is java.lang.RuntimeException: Unable to invoke no-args constructor for interface javax.json.JsonValue. Register an InstanceCreator with Gson for this type may fix this problem.
response = {StringBuffer@5339} "{ "success": true, "challenge_ts": "2016-07-26T14:52:29Z", "hostname": "localhost"}"
response.toString = "{ "success": true, "challenge_ts": "2016-07-26T14:52:29Z", "hostname": "localhost"}"
Gson gson = new Gson();
JsonObjectjsonObject = gson.fromJson(response.toString(),String.class); //response type is StringBuffer.
return jsonObject.getBoolean("success");
Thanks for the help.