Pregunta

I made a twitter integration to my android app. I used this great tutorial, with this twitter integration source.

I developing to android since March, so im not a professional or something, but there is one thing i know.

If you write your well working code for Android 2.3+ and for Android 4+ there will be always the Tablet version Os of Android (3+) that will generally do SOMETHING to mess up your work. I seen many of these situations...

The twitter integration that i made from the tutorial works great on Android 2.3 and 4 but it does some buggy thing on Android 3.2 (Samsung Galaxy Tab)

It is very strange because the problem is with OAUth retrieve request token, and i cannot figure out why...

I ran the very same code on the different Androids of course. On 2.3 the OAuth makes everything fine, twitter logs in and i can tweet messages, from 3.1 there is an error, here is the logcat:

06-19 02:15:21.760: W/DefaultRequestDirector(13255): Authentication error: Unable to respond to any of these challenges: {}
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255): Error during OAUth retrieve request token
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255): oauth.signpost.exception.OAuthNotAuthorizedException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:239)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at com.KeySoft.TwitterIntegration.OAuthRequestTokenTask.doInBackground(OAuthRequestTokenTask.java:70)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at com.KeySoft.TwitterIntegration.OAuthRequestTokenTask.doInBackground(OAuthRequestTokenTask.java:1)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at android.os.AsyncTask$2.call(AsyncTask.java:252)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
06-19 02:15:21.760: E/com.KeySoft.TwitterIntegration.OAuthRequestTokenTask(13255):  at java.lang.Thread.run(Thread.java:1020)

So please someone explain me, why Android 3+ always do things DIFFERENT than previsous and future versions of it, cause it seems to me it is an authentication problen, and why cant i retrieve the request token if i ran the very same code, call the very same url-s with the very same keys and signatures that needed.

¿Fue útil?

Solución

Make sure that Time Zone and Date is set accordingly on problematic device...:-)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top