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 Weird ERROR

Hi I have been following the Blog reader app tutorials and I'm having a small yet very weird problem. I'm following the tutorial but am putting a little twist on it by making it list different exercises. So for this, I built my own json file. Now I have gotten all the json titles to show all correctly and well in emulator, but when i put it on my phone it doesn't work (throws me a JSONException - Unterminated String...). But the weird part is, this only happens when I put it on my shared mochahost.com hosting server. When I put it somewhere else like on 000webhost.com free account, everything works. Is there something that needs to be set on the servers to allow access? And if so, how come the emulator can access it and not the phone? Thanks!

4 Answers

Hi there, have you tried modifying the permissions of the file? Usually service providers allow this through requesting permission change via email or something alike.

Yup just checked permissions on both the servers...they are exactly the same, 644.

Try with 755 for the one which does not work.

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

That JSONException occurs sometimes because of a bug in the code, actually. Check out this earlier Forum post and see if it addresses your issue: https://teamtreehouse.com/forum/parsing-data-returned-in-json-jsonexception-unterminated-string-at-character-5792