Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Vamsi Pavan Mahesh Gunturu
4,541 PointsHow to convert a String into JSON String
I am calling an Online API which returns data in the JSON format, Since I am HTTPUrlConnection, InputStreamReader, I get a stringbuffer which has all the JSON in the form of string. Is there a library to convert this to JSON format, so I can easily access the nested structures
2 Answers

Seth Kroger
56,415 Pointsorg.json (included as standard in Android): https://github.com/douglascrockford/JSON-java Jackson: https://github.com/FasterXML/jackson

Daniel Santos
34,969 PointsHi,
I know that I am very late responding to this question, but this is for future reference.
http://stackoverflow.com/questions/5245840/how-to-convert-string-to-jsonobject-in-java
I believe this a very easy way to do it. You can look at the JSONObject's documentation for further instruction.
http://www.json.org/javadoc/org/json/JSONObject.html
-Dan