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

Setup

First of all, we will need to add relevant dependencies so we that can load the Twitter4J library. To do this, as usual, add the following entries to app/build.gradle:

compile 'org.twitter4j:twitter4j-core:4.0.6'compile 'org.twitter4j:twitter4j-stream:4.0.6'

The first line is a general interface to the Twitter API (to make status updates, for example) that contains the core domain objects, such as Status or User.

The following line adds support for streaming the Twitter API through TwitterStream, which allows you to constantly listen for the status updates without making multiple connections to Twitter:

compile 'org.twitter4j:twitter4j-stream:4.0.6'
More information about Twitter4J is available at http://twitter4j.org/en/index.html#introduction ...

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