Search in sources :

Example 31 with ConfigurationBuilder

use of twitter4j.conf.ConfigurationBuilder in project intellij-community by JetBrains.

the class StudyTwitterUtils method getTwitter.

/**
   * Set consumer key and secret. 
   * @return Twitter instance with consumer key and secret set.
   */
@NotNull
public static Twitter getTwitter(@NotNull final String consumerKey, @NotNull final String consumerSecret) {
    ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
    configurationBuilder.setOAuthConsumerKey(consumerKey);
    configurationBuilder.setOAuthConsumerSecret(consumerSecret);
    return new TwitterFactory(configurationBuilder.build()).getInstance();
}
Also used : ConfigurationBuilder(twitter4j.conf.ConfigurationBuilder) TwitterFactory(twitter4j.TwitterFactory) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ConfigurationBuilder (twitter4j.conf.ConfigurationBuilder)31 TwitterFactory (twitter4j.TwitterFactory)9 Configuration (twitter4j.conf.Configuration)4 TwitterStreamFactory (twitter4j.TwitterStreamFactory)3 AppSettings (com.klinker.android.twitter.settings.AppSettings)2 Map (java.util.Map)2 OAuth2Token (twitter4j.auth.OAuth2Token)2 OAuthAuthorization (twitter4j.auth.OAuthAuthorization)2 AlarmManager (android.app.AlarmManager)1 AlertDialog (android.app.AlertDialog)1 PendingIntent (android.app.PendingIntent)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 View (android.view.View)1 Animation (android.view.animation.Animation)1 CookieManager (android.webkit.CookieManager)1 WebView (android.webkit.WebView)1 WebViewClient (android.webkit.WebViewClient)1 TextView (android.widget.TextView)1 ViewSwitcher (android.widget.ViewSwitcher)1