views:

421

answers:

3

Android:

i am unable to execute following code

http://code.google.com/p/andriod-mytwitter/source/browse/MyTwitter2/src/com/example/TwitterClient.java?spec=svn37&r=37

gives verifying error at

OAuthSignpostClient client = new OAuthSignpostClient(CONSUMER_KEY, CONSUMER_SECRET, "http://localhost");

Following is the used code

OAuthSignpostClient client = new OAuthSignpostClient(CONSUMER_KEY, CONSUMER_SECRET, "http://localhost");
                Twitter jtwit = new Twitter("tgreening", client);
                // open the authorisation page in the user's browser
                client.authorizeUrl();
//              // get the pin
//              String v = client.askUser("Please enter the verification PIN from Twitter");
                client.setAuthorizationCode("123");
                // Optional: store the authorisation token details
                Object accessToken = client.getAccessToken();
  • What "http://localhost" being passed in place of "oob"
  • I register my app and have key and secret
  • what is setAuthorizationCode "123" ? is it the user's password ? or some thing else

When i run it gives verify error.

please guide me

A: 

Check my post. It helps. you can use the XAuth Authentication with Twitter4j. It more efficient. you have to pass the Conumer_Key and ConsumerSecretkey for system properties. then you get the Accesstoken and Access token secret. you to store it locally and you can access the account whenever you need to access the account.

Praveen Chandrasekaran
i am using android 1.5 as you said it will work later version not 1.5.not work for me.
Faisal khan
Sorry for that. i will remove that words in my question. It works for me. i working in 1.6.
Praveen Chandrasekaran
A: 

Chris stewart posted the rite solution

http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html

Faisal khan
A: 

The answers are in twitter4j. Any answers using jtwitter?

exp