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

Configuring Twitter

First of all, Twitter and thus Twitter4J requires us to set up credentials so that we can access Twitter's API. If you have done that already, it will be easy to proceed further. If not, go to https://apps.twitter.com/ to create an application that can be used to obtain the credentials.

When the credentials are obtained, we will need to create a special Configuration object where the credentials will be stored:

final Configuration configuration = new ConfigurationBuilder()        .setDebugEnabled(true)        .setOAuthConsumerKey("enterYourDataHere")        .setOAuthConsumerSecret("enterYourDataHere")        .setOAuthAccessToken("enterYourDataHere")        .setOAuthAccessTokenSecret("enterYourDataHere")        .build();

That's it. The following line is useful ...

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