O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listening to status updates

When the Configuration object is available, we can start setting up the code to monitor status updates and receive that data into our application.

Firstly, we need to acquire the TwitterStream object with this:

TwitterStream twitterStream = new TwitterStreamFactory(configuration).getInstance();

Next, we will need to create a listener that will be receiving the status updates. The listener is created with this:

StatusListener listener = new StatusListener() {    @Override    public void onStatus(Status status) {        System.out.println(status.getUser().getName() + " : " +         status.getText());    }    @Override    public void onDeletionNotice(StatusDeletionNotice         statusDeletionNotice) {    }    @Override    public void onTrackLimitationNotice( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required