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
Stefan Buttigieg
10,065 PointsParsing Local JSON File and adapting it to List View
Dear Treehouse Friends,
I've successfully completed the Android Blog Reader Project for the second time round and I've been struggling quite alot to try and parse JSON stored in the assets folder(heck I even tried storing the JSON in an Assets folder).
The JSON is available here : http://pastebin.com/aLhaGmFB
I've tried out the following links and answers to solve my project but none have really helped out:
The titles that I want to populate the list view from the JSON are marked as 'guideline' whilst the 'guidelinepath' is a path to HTML files that I would like to store in the app and show off in the WebView(this I will solve seperately haha)
Any inspiration would be appreciated!
3 Answers
Stefan Buttigieg
10,065 PointsSolved :) !
Will share my solution very soon via a Blog Post. WebView challenge also resolved ...had some other obstacle there haha!
Cheers!
Matthew Mascioni
20,444 PointsCan't wait for it! :)
Sean Gallagher
2,054 PointsJust to clarify, if you want to use getResources or openRawResource the static JSON needs to be under the res folder of your project. And if you'd like to have the JSON in a subfolder like in your example res/raw then you're referencing that subfolder with R.raw.localjsonfile? So if my folder structure was res/data then I would use R.data.localjsonfile?
Thanks in advance.