即使使用最新的Twitter 4J 3.0.3,Android Twitter集成仍然失败

时间:2013-11-28 06:05:49

标签: android twitter integration social-networking

您好我正在使用此Project。我用最新版本(3.0.3)替换旧的Twitter4j。​​

我也改变了

   mHttpOauthprovider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize"); 

  mHttpOauthprovider = new DefaultOAuthProvider("https://api.twitter.com/oauth/request_token", "https://api.twitter.com/oauth/access_token","https://api.twitter.com/oauth/authorize");

我收到了这个错误。请帮助我。

错误:

11-28 11:33:44.574: W/System.err(334): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.twitter.com/oauth/request_token
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
11-28 11:33:44.583: W/System.err(334):  at com.twitter.android.TwitterApp$2.run(TwitterApp.java:126)
11-28 11:33:44.583: W/System.err(334): Caused by: java.io.FileNotFoundException: https://api.twitter.com/oauth/request_token
11-28 11:33:44.583: W/System.err(334):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)
11-28 11:33:44.583: W/System.err(334):  at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:253)
11-28 11:33:44.583: W/System.err(334):  at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)
11-28 11:33:44.594: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228)
11-28 11:33:44.594: W/System.err(334):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
11-28 11:33:44.594: W/System.err(334):  ... 2 more

1 个答案:

答案 0 :(得分:1)

仅供参考,当前版本的API为1.1。

您已使用的所有网址均已弃用,正确路径的一个示例为:

例如:

https://api.twitter.com/oauth/request_token