Twitter Integration on Android App

how to integrate twitter in android for twitter login after it's removal from fabric?

Instead of

Fabric.with(this, new Twitter(authConfig));

write this:

        TwitterConfig.Builder builder=new TwitterConfig.Builder(this);
builder.twitterAuthConfig(authConfig);
Twitter.initialize(builder.build());

Also,you need to add this line in gradle(app level) :

compile 'com.twitter.sdk.android:twitter:3.0.0'

twitter integration on android app

In addition to d.'s solid choices, you could:

  • Use ACTION_SEND Intents with createChooser(), and if the user has a Twitter application installed (Twidroid) they can use it to update their status
  • Use an existing Twitter Java API, like JTwitter

Twitter Integration in android using twitter4j-4.0.1

I was having the same problem. I referred to this tutorial and it works - http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/

and also they have updated to twitter4j-core-4.0.1

Source code can be found here - https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client

Twitter Integration in android using twitter application

Twitter just launched an official SDK that with only a few lines of code you have Sign in with Twitter working and with all alternate authentication flows implemented (having Twitter app installed, not installed, user cancelation, etc)

Check: http://t.co/fabric

Example:

private void setUpTwitterButton() {
twitterButton = (TwitterLoginButton) findViewById(R.id.twitter_button);
twitterButton.setCallback(new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> result) {
// TODO: success flow
}

@Override
public void failure(TwitterException exception) {
// TODO: failure flow
}
});
}

The access token will be in the result object of success method above.

The Android docs are here: http://t.co/fabric-android

If you want to see a app sample with this SDK: https://github.com/twitterdev/cannonball-android

Android Application with twitter integration

try Twitter4j

Github link

This link has examples too



Related Topics



Leave a reply



Submit