Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Christiaan Hendriksen
5,982 PointsmBlogData exception
The data in the app wasn't updating, so I added a log for
if (mBlogData == null)
The exception is:
Exception caught:
org.json.JSONException: Unterminated string at character 2745 of {"status":"ok","count":10,"count_total":1827,"pages":183,"posts":[{"id":24096,"url":"http:\/\/blog.teamtreehouse.com\/marcus-charlotte-launched-successful-web-app-traveling-world","title":"Marcus & Charlotte Launched a Successful Web App While Traveling the World","date":"2014-08-30 14:17:51","author":"Faye Bridge","thumbnail":null},{"id":24060,"url":"http:\/\/blog.teamtreehouse.com\/jason-surfrapp","title":"Interview: Jason Surfrapp","date":"2014-08-28 09:00:44","author":"Gill Carson","thumbnail":"http:\/\/blog.teamtreehouse.com\/wp-content\/uploads\/2014\/08\/creativity-150x150.jpg"},{"id":24057,"url":"http:\/\/blog.teamtreehouse.com\/new-course-advanced-sass","title":"New Course: Advanced Sass","date":"2014-08-27 16:38:52","author":"Dale Sande","thumbnail":"http:\/\/blog.teamtreehouse.com\/wp-content\/uploads\/2014\/08\/dale-150x150.jpg"},{"id":24027,"url":"http:\/\/blog.teamtreehouse.com\/learn-javascript","title":"Why Now is the Best Time to Learn JavaScript","date":"2014-08-27 14:08:50","a������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Looking at the JSON object in the debugger, it ends with hundreds of ���������
2 Answers

Harry James
14,780 PointsI also had this issue, however Hubert Maraszek has a great fix (At https://teamtreehouse.com/forum/trying-to-retrieve-data-from-my-own-blog-help).
If you delete these lines:
int contentLength = connection.getContentLength();
char[] charArray = new char[contentLength];
reader.read(charArray);
String responseData = new String(charArray);
and replace them with these:
int nextCharacter; // read() returns an int, we cast it to char later
String responseData = "";
while(true){ // Infinite loop, can only be stopped by a "break" statement
nextCharacter = reader.read(); // read() without parameters returns one character
if(nextCharacter == -1) // A return value of -1 means that we reached the end
break;
responseData += (char) nextCharacter; // The += operator appends the character to the end of the string
then it should fix the issue :)

Tiffanie Kyker
949 PointsCan you put your actual code up.
Christiaan Hendriksen
5,982 PointsChristiaan Hendriksen
5,982 PointsNeeds an } at the end of the while statement, but works otherwise!
Thanks :)