Android Twitter API: statusesService.homeTimeline feed limited, only 20 tweets loading

android
service-status
api

#1

I’ve made an app that displays the logged in user’s timeline but the Twitter API only displays about 20 tweets at once.

Any ideas please?

private void refreshTimeline() {
    TwitterApiClient twitterApiClient = Twitter.getApiClient();
    StatusesService statusesService = twitterApiClient.getStatusesService();
    statusesService.homeTimeline(null, null, null, null, null, null, null, new Callback<List<Tweet>>() {

        @Override
        public void success(Result<List<Tweet>> result) {
            tweetList = result.data;
            adapter.setTweets(tweetList);
        }

        @Override
        public void failure(TwitterException e) {
        }
    });
}

#2

@lararufflecoles Just to confirm, you’ve used Fabric to generate your keys and thus using Guest authentication, not application authentication? If so, I’ll just move this post to that thread.


#3

I’ve used Fabric yes, and I login with a user. Is that clear?


#4

Hi Lara, the response from our API will return 20 tweets at a time by default- see this page for details, including some docs on how to pull timelines most efficiently:

https://dev.twitter.com/rest/reference/get/statuses/home_timeline


#5

Hi beardigsit,

Thanks for that, I re-read the JavaDoc info and it makes more sense now, I’ve just changed my first null to 100 (etc).

:-).


#6

Awesome! Glad it’s all working now :slight_smile:


#7