I am working on the Twitter Authentication
. The Basic Authentication will expire on August 16th onwards. So we have to use OAuth
to use Twitter Authentication. But Its some Complicated to implement. XAuth
is cuts off the two steps. But the Problem is i used Twitter4j
to authenticate.And also had bad documentation too. I want to use XAuth from 1.6 itself. Which package you suggest to use. and If any example
or tutorial
for specifiacally for Android to use XAuth
Authentication.
Asked
Active
Viewed 3,827 times
1

Praveen
- 90,477
- 74
- 177
- 219
1 Answers
3
EDIT: In my code I did this:
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());
}
}
When you want to use your Token you just do this:
TwitterFactory factory = new TwitterFactory();
Twitter twitter = factory.getInstance();
twitter.setOAuthConsumer("[consumer key]", "[consumer secret]");
AccessToken accessToken = loadAccessToken();
twitter.setOAuthAccessToken(accessToken);

pixel
- 24,905
- 36
- 149
- 251
-
These thinks are all i found in the twitter4j official site itself. Its getting the NullPointerException at the Second Time. And also in that site supports from Android 2.1.0. is that a problem? – Praveen Jul 21 '10 at 08:38
-
Can you tell something about the Login and logout options using XAuth? – Praveen Jul 21 '10 at 09:55
-
AFAIK you need only just to remove AccessToken - without this you won't be able to login :) – pixel Jul 21 '10 at 13:41
-
1Usually xAuth needs to be especially enabled for an application to use it. – Heiko Rupp Feb 18 '11 at 09:43