Twitter newsfeed on Android

android

#1

I can get a Timeline with UserTimeline builder and show it with a listview, something like:

UserTimeline userTimeline = new UserTimeline.Builder()
            .screenName("iregados")
            .build();
    final TweetTimelineListAdapter adapter = new TweetTimelineListAdapter(this, userTimeline);

    ListView myList=(ListView)findViewById(R.id.list);
    myList.setAdapter(adapter);

How can i get the newsfeed instead of timeline and show it with a listview?


#2

What exactly do you mean by newsfeed? That’s not something that I understand as an element of Twitter. Can you point me to an example URL?


#3

Maybe it’s just a misunderstanding by me about what twitter calls timeline…

I think that:

  • timeline is a list of tweets of some user (the user that I insert in screenName)
  • newsfeed is what you see when you get in your own twitter (tweets of people you follow)

Am I wrong?


#4

Ah! OK I understand now.

We have two concepts here - user timeline (a list of Tweets from an individual user) and home timeline (the view of Tweets from your followers when you login to Twitter).

We don’t have an API method in Twitter Kit for displaying home timelines, I’m afraid.


#5

But can I get the hometimeline using the REST api?

something like:

        TwitterApiClient twitterApiClient = Twitter.getApiClient();
        StatusesService statusesService = twitterApiClient.getStatusesService();

and use the statusesService to reach the hometimeline?

If it’s possible, where can i find to documentation to learn how to do that?


#6

a litle research here and there and I managed to get the HomeTimeline by:

            TwitterApiClient twitterApiClient = Twitter.getApiClient();
            StatusesService statusesService = twitterApiClient.getStatusesService();

            statusesService.homeTimeline(null, null, null, null, null, contributor_details, include_entities,
                new Callback<List<Tweet>>() {
                    @Override
                    public void success(Result<List<Tweet>> result) {
                        //result.data contains every Tweet we need from HomeTimeline!!!!
                    }

                    public void failure(TwitterException exception) {
                    }
                }
        );

now I just need to work with views to get my HomeTimeline the way I want

Thanks for your attention…I think that it’s ok to close this topic…


#7