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.
Endless scroll in listview for the blogreader
I have finished the blog reader app. I also added a custom listview to show the thumbnail. I was wondering how do I add endless scroll to the blog reader app? Also is there an api call to load data by mentioning the start and end position ? For example http://blog.teamtreehouse.com/api/get_recent_summary/?start=10&end=20.
Also one of the problem I face with the blog reader app is that when I increase the count in the url the app never loads. Data is truncated while reading the json and I see an exception.
How should I fix these problems so that the app becomes more usable ?
Ben JakubenTreehouse Teacher
Good question! There are two parts, so I'll try to answer both:
Regarding the error you see trying to get more posts--that's a known issue that you can fix with some alternate code. Check the Teacher Notes in this video for a link to a Forum post with code that fixes the issue. Put that in place and you can request a higher number of posts.
For endless scrolling, check out this library from GitHub: https://github.com/thecodepath/android_guides/wiki/Endless-Scrolling-with-AdapterViews. You could request more posts at the beginning and chunk them together, or you could use different methods from the API we are using. Check out the docs here to see about how you could possibly request different sets of posts: https://wordpress.org/plugins/json-api/other_notes/ (Perhaps
get_date_postscould be useful.) Though I'm not entirely sure if we enabled all the different API calls or not on our blog!