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

Android Build a Blog Reader Android App Getting Data from the Web Parsing Data Returned in JSON Format

jsonResponse on Android Studio! Help !

Im using android Studio rather than Eclipse, but I ran into a problem. In the video, Eclipse is being used, and I cant get the String JSON the same way as shown in this video...

Hi! Please provide some code and I'll help you out!

JSONObject jsonResponse = new JSONObject();

In Eclipse, you are able to choose the String parameter by pressing ctrl space, but in Studio, it doesnt show anything to create a new json object

You can just type it manually.

1 Answer

In android studio there is only 1 option to select from, so select that :)

Im not sure I understand, In the video, a string json sign appeared above jsonResponse, but Im not sure how to do that in Studio

That doesn't appear in Android studio. Instead it gives JSONObject(org.json) and that is the right one to use. It does not appear like it does in Eclipse. I used that and it worked the same way.

Im about to try it out, but thanks in advance :)

Im about to try it out, but thanks in advance :)

You are welcome :)