开发者

Problem in Twitter Api - Android

开发者 https://www.devze.com 2023-03-18 20:47 出处:网络
I am using the following link to integrate Twitter API into my application. http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/

I am using the following link to integrate Twitter API into my application.

http://blog.doityourselfandroid.com/2011/02/13/guide-to-integrating-twitter-android-application/

Now when i run th开发者_Python百科e code after setting up the SECRET KEY AND CONSUMER KEY on the emulator it runs fine. BUt when i run that application on mobile device it gives me Exception.

The Exception is:

Error during OAUth retrieve request token
Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.
  auth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:239)
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
 at com.ecs.android.sample.twitter.OAuthRequestTokenTask.doInBackground(OAuthRequestTokenTask.java:57)
 at com.ecs.android.sample.twitter.OAuthRequestTokenTask.doInBackground(OAuthRequestTokenTask.java:1)
 at android.os.AsyncTask$2.call(AsyncTask.java:185)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
 at java.util.concurrent.FutureTask.run(FutureTask.java:137)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
 at java.lang.Thread.run(Thread.java:

Friends what should i do.? m Tottaly messed. n stucked.

Please Guide me any one.


It worked just entering in Constants.java the Consumer key and Consumer secret, and pay

attention to give on twitter page, for Twitter Application also Write access: READ&WRITE.

By the way, I made the new application registration on developer site:

https://dev.twitter.com and i saw posted message on account on:

http://twitter.com. I got that black screen too with login errors first time because i had

just Read enabled, after giving also write it worked.

Anyway, if you did not succed, here is another link i found, with keys filled for a test

application and only to be replaced by yours:

http://abhinavasblog.blogspot.com/2011/06/for-all-my-code-thirsty-frie nds-twitter.html

Hope this helps, Regards.

0

精彩评论

暂无评论...
验证码 换一张
取 消