をTwitterに接続するためのアプリケーションを承認し、次のコード:アンドロイド:
public static void OAuthLogin(Activity a) {
try {
twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(key, secret);
RequestToken requestToken = twitter.getOAuthRequestToken(CALLBACK);
String authUrl = requestToken.getAuthenticationURL();
a.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
} catch (TwitterException ex) {
Log.e("in Main.OAuthLogin", ex.getMessage());
}
}
となっ
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
私はCALLABACK
のparamすべての罰金を削除するとtwitter.getOAuthRequestToken()
を実行する - I PINを取得できるtwitterのログインページにリダイレクトされています。私は、ユーザーがPINを処理してアプリに戻すことを望まないということです。どのように達成するのですか?
EDIT:が問題を引き起こしているものを見つけ、問題
HI、ソケットタイムアウトが発生しました。例外11-20 13:33:11.679:WARN/System.err(3308):操作がタイムアウトしましたoutTwitterException {exceptionCode = [8dda30a8-エラーコード:61299907 8dda30a8-612998dc]、statusCode = -1、retryAfter = 0、rateLimitStatus = null、version = 2.1.6} 11-20 13:33:11.679:WARN/System.err(3308):原因:java.net .SocketException:操作がタイムアウトしました – Abi