Android: I am trying the following xAuth example for android share.
xAuth Authentication for Twitter Share in Android?
System.setProperty("twitter4j.oauth.consumerKey", "your token");
System.setProperty("twitter4j.oauth.consumerSecret", "your token secret");
Twitter twitter = new TwitterFactory().getInstance(login, password);
AccessToken accessToken = twitter.getOAuthAccessToken();
//Then you must save your Token and Token secret from AccesToken
if (mAccessToken != null) {
if (mAccessToken.getToken() != null && mAccessToken.getTokenSecret() != null) {
saveAccessToken(mAccessToken.getToken(), mAccessToken.getTokenSecret());
}
}
I am having IllegalStateException
Exception Msg: java.lang.IllegalStateException: OAuth consumer key/secret combination not supplied
at the following line
AccessToken accessToken = twitter.getOAuthAccessToken();
I made changes some thing like following
Twitter twitter = new TwitterFactory().getInstance("login", "pass");
twitter.setOAuthConsumer(getString(R.string.twtAPIKey), getString(R.string.twtSecret));
AccessToken mAccessToken = twitter.getOAuthAccessToken();
and again I got exception
Exception Msg: java.lang.IllegalStateException: Basic authenticated instance.
Any working example of xAuth ?