How to get JSON for statuses/home_timeline.json using TwitterApiClient?

restapi
android
rest

#1

I want JSON from ‘GET statuses/home_timeline’

I wrote ‘TwitterApiClient’ class as,
…>

public class MyTwitterApiClient extends TwitterApiClient {
    public MyTwitterApiClient(TwitterSession session) {
        super(session);
    }

    public HomeTimeline getHomeTimeline(){
        return getService(HomeTimeline.class);
    }
}

interface HomeTimeline{

    @GET("/1.1/statuses/home_timeline.json")
    void show(Callback<List<Tweet>> cb);
}

…>

And called above using,

…>

new MyTwitterApiClient(session).getHomeTimeline().show(new Callback<List<Tweet>>() {
            @Override
            public void success(Result<List<Tweet>> result) {
                Log.e(TwitterTimelineFragment.class.getSimpleName(), "Twitter Session: Downloaded!");
            }

            @Override
            public void failure(TwitterException exception) {

            }
});

…>

Please let me know what’s wrong with this code?


#2

Moving this thread to the Rest API forum as this is not a Fabric specific question.