OAuth、Twitter 和 Android 的问题:与服务器的 http 通信失败

发布于 2024-11-15 02:54:34 字数 10251 浏览 3 评论 0原文

有谁有 Android 上的 twitter 的 OAuth 身份验证的工作示例吗?我尝试过使用 Twitter4J 和 SignPost,但收到非常奇怪的错误,提示 twitter.com 是未知主机。我了解到 SignPost 库存在问题(Google Android),并且Android 和根据项目的主页,CommonsHttpOAuth* 类应该可以工作。

这是我的 SignPost:

private void getReqTokenAndAuthenticateUsingSignPost() {
    String callbackUrl = "twitter-test:///";
    CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,
            CONSUMER_SECRET);
    CommonsHttpOAuthProvider provider = new CommonsHttpOAuthProvider(
            "http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token",
            "http://twitter.com/oauth/authorize");

    String tokenStr = consumer.getToken();
    String tokenSecretStr = consumer.getTokenSecret();

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    Editor edit = preferences.edit();
    edit.putString(REQ_TOKEN, tokenStr);
    edit.putString(REQ_TOKEN_SECRET, tokenSecretStr);

    try {
        String authUrl = provider.retrieveRequestToken(consumer, callbackUrl);
        Uri authenticationUri = Uri.parse(authUrl);
        startActivity(new Intent(Intent.ACTION_VIEW, authenticationUri));
    } catch (OAuthMessageSignerException e) {
        e.printStackTrace();
    } catch (OAuthNotAuthorizedException e) {
        e.printStackTrace();
    } catch (OAuthExpectationFailedException e) {
        e.printStackTrace();
    } catch (OAuthCommunicationException e) {
        e.printStackTrace();
    }

}

这是我的 Twitter4J 代码:

private void getReqTokenAndAuthenticateUsingTwitter4J() {

    String callbackUrl = "twitter-test:///";
    try {
        // Prepare a request token, based on consumer key and consumer
        // secret
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setOAuthConsumerKey(CONSUMER_KEY);
        builder.setOAuthConsumerSecret(CONSUMER_SECRET);
        Configuration cfg = builder.build();
        Twitter t = new TwitterFactory(cfg).getInstance();

        RequestToken requestToken = t.getOAuthRequestToken(callbackUrl);
        String tokenStr = requestToken.getToken();
        String tokenSecretStr = requestToken.getTokenSecret();

        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        Editor edit = preferences.edit();
        edit.putString(REQ_TOKEN, tokenStr);
        edit.putString(REQ_TOKEN_SECRET, tokenSecretStr);
        if (edit.commit()) {
            // Launch the browser for authentication in twitter's web-gui
            Uri authenticationUri = Uri.parse(requestToken.getAuthenticationURL());
            startActivity(new Intent(Intent.ACTION_VIEW, authenticationUri));
        }
    } catch (TwitterException e) {
        e.printStackTrace();
    }
}

是的,我有一个具有互联网权限的清单和一个用于回调 url 的意图过滤器。这是运行 SignPost 代码时 logcat 的输出:

W/System.err(  779): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: twitter.com
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
W/System.err(  779):    at com.examples.twitterimages.TwitterImagesActivity.getReqTokenAndAuthenticateUsingSignPost(TwitterImagesActivity.java:109)
W/System.err(  779):    at com.examples.twitterimages.TwitterImagesActivity.onCreate(TwitterImagesActivity.java:64)
W/System.err(  779):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(  779):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
W/System.err(  779):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
W/System.err(  779):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
W/System.err(  779):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
W/System.err(  779):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  779):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  779):    at android.app.ActivityThread.main(ActivityThread.java:3701)
W/System.err(  779):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  779):    at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err(  779):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
W/System.err(  779):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
W/System.err(  779):    at dalvik.system.NativeStart.main(Native Method)
W/System.err(  779): Caused by: java.net.UnknownHostException: twitter.com
W/System.err(  779):    at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
W/System.err(  779):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
W/System.err(  779):    at java.net.InetAddress.getAllByName(InetAddress.java:256)
W/System.err(  779):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
W/System.err(  779):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
W/System.err(  779):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
W/System.err(  779):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
W/System.err(  779):    at oauth.signpost.commonshttp.CommonsHttpOAuthProvider.sendRequest(CommonsHttpOAuthProvider.java:64)
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
W/System.err(  779):    ... 16 more

这是运行 Twitter4J 代码时的输出:

W/System.err(  817): api.twitter.comRelevant discussions can be on the Internet at:
W/System.err(  817):    http://www.google.co.jp/search?q=6c607809 or
W/System.err(  817):    http://www.google.co.jp/search?q=0f1d8134
W/System.err(  817): TwitterException{exceptionCode=[6c607809-0f1d8134 6c607809-0f1d810a], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.2.1}
W/System.err(  817):    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
W/System.err(  817):    at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
W/System.err(  817):    at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:102)
W/System.err(  817):    at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:108)
W/System.err(  817):    at twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:271)
W/System.err(  817):    at com.examples.twitterimages.TwitterImagesActivity.getReqTokenAndAuthenticateUsingTwitter4J(TwitterImagesActivity.java:136)
W/System.err(  817):    at com.examples.twitterimages.TwitterImagesActivity.onCreate(TwitterImagesActivity.java:64)
W/System.err(  817):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(  817):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
W/System.err(  817):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
W/System.err(  817):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
W/System.err(  817):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
W/System.err(  817):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  817):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  817):    at android.app.ActivityThread.main(ActivityThread.java:3701)
W/System.err(  817):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  817):    at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err(  817):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
W/System.err(  817):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
W/System.err(  817):    at dalvik.system.NativeStart.main(Native Method)
W/System.err(  817): Caused by: java.net.UnknownHostException: api.twitter.com
W/System.err(  817):    at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
W/System.err(  817):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
W/System.err(  817):    at java.net.InetAddress.getAllByName(InetAddress.java:256)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:614)
W/System.err(  817):    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:162)
W/System.err(  817):    ... 19 more

有人解决了这个问题吗?我被困在这里了。我可以让代码作为 Java SE 程序运行,但它在 Android 上失败...

// Jonas

Does anyone have a working example of OAuth authentication for twitter with Android? I have tried to use both Twitter4J and SignPost, but I get very strange errors, saying twitter.com is an unknown host. I have understod that there is a problem (under Google Android) with the SignPost library and Android and according to the project's home-page, the CommonsHttpOAuth* classes shall work.

Here is my SignPost:

private void getReqTokenAndAuthenticateUsingSignPost() {
    String callbackUrl = "twitter-test:///";
    CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,
            CONSUMER_SECRET);
    CommonsHttpOAuthProvider provider = new CommonsHttpOAuthProvider(
            "http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token",
            "http://twitter.com/oauth/authorize");

    String tokenStr = consumer.getToken();
    String tokenSecretStr = consumer.getTokenSecret();

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    Editor edit = preferences.edit();
    edit.putString(REQ_TOKEN, tokenStr);
    edit.putString(REQ_TOKEN_SECRET, tokenSecretStr);

    try {
        String authUrl = provider.retrieveRequestToken(consumer, callbackUrl);
        Uri authenticationUri = Uri.parse(authUrl);
        startActivity(new Intent(Intent.ACTION_VIEW, authenticationUri));
    } catch (OAuthMessageSignerException e) {
        e.printStackTrace();
    } catch (OAuthNotAuthorizedException e) {
        e.printStackTrace();
    } catch (OAuthExpectationFailedException e) {
        e.printStackTrace();
    } catch (OAuthCommunicationException e) {
        e.printStackTrace();
    }

}

and here is my code for Twitter4J:

private void getReqTokenAndAuthenticateUsingTwitter4J() {

    String callbackUrl = "twitter-test:///";
    try {
        // Prepare a request token, based on consumer key and consumer
        // secret
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setOAuthConsumerKey(CONSUMER_KEY);
        builder.setOAuthConsumerSecret(CONSUMER_SECRET);
        Configuration cfg = builder.build();
        Twitter t = new TwitterFactory(cfg).getInstance();

        RequestToken requestToken = t.getOAuthRequestToken(callbackUrl);
        String tokenStr = requestToken.getToken();
        String tokenSecretStr = requestToken.getTokenSecret();

        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        Editor edit = preferences.edit();
        edit.putString(REQ_TOKEN, tokenStr);
        edit.putString(REQ_TOKEN_SECRET, tokenSecretStr);
        if (edit.commit()) {
            // Launch the browser for authentication in twitter's web-gui
            Uri authenticationUri = Uri.parse(requestToken.getAuthenticationURL());
            startActivity(new Intent(Intent.ACTION_VIEW, authenticationUri));
        }
    } catch (TwitterException e) {
        e.printStackTrace();
    }
}

and yes, I have a manifest with Internet permission and an intent filter for the callback-url. Here is the output from logcat when running the SignPost code:

W/System.err(  779): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: twitter.com
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
W/System.err(  779):    at com.examples.twitterimages.TwitterImagesActivity.getReqTokenAndAuthenticateUsingSignPost(TwitterImagesActivity.java:109)
W/System.err(  779):    at com.examples.twitterimages.TwitterImagesActivity.onCreate(TwitterImagesActivity.java:64)
W/System.err(  779):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(  779):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
W/System.err(  779):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
W/System.err(  779):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
W/System.err(  779):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
W/System.err(  779):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  779):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  779):    at android.app.ActivityThread.main(ActivityThread.java:3701)
W/System.err(  779):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  779):    at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err(  779):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
W/System.err(  779):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
W/System.err(  779):    at dalvik.system.NativeStart.main(Native Method)
W/System.err(  779): Caused by: java.net.UnknownHostException: twitter.com
W/System.err(  779):    at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
W/System.err(  779):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
W/System.err(  779):    at java.net.InetAddress.getAllByName(InetAddress.java:256)
W/System.err(  779):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
W/System.err(  779):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
W/System.err(  779):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
W/System.err(  779):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
W/System.err(  779):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
W/System.err(  779):    at oauth.signpost.commonshttp.CommonsHttpOAuthProvider.sendRequest(CommonsHttpOAuthProvider.java:64)
W/System.err(  779):    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
W/System.err(  779):    ... 16 more

and here is the output when running the Twitter4J code:

W/System.err(  817): api.twitter.comRelevant discussions can be on the Internet at:
W/System.err(  817):    http://www.google.co.jp/search?q=6c607809 or
W/System.err(  817):    http://www.google.co.jp/search?q=0f1d8134
W/System.err(  817): TwitterException{exceptionCode=[6c607809-0f1d8134 6c607809-0f1d810a], statusCode=-1, retryAfter=0, rateLimitStatus=null, version=2.2.1}
W/System.err(  817):    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:204)
W/System.err(  817):    at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
W/System.err(  817):    at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:102)
W/System.err(  817):    at twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:108)
W/System.err(  817):    at twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:271)
W/System.err(  817):    at com.examples.twitterimages.TwitterImagesActivity.getReqTokenAndAuthenticateUsingTwitter4J(TwitterImagesActivity.java:136)
W/System.err(  817):    at com.examples.twitterimages.TwitterImagesActivity.onCreate(TwitterImagesActivity.java:64)
W/System.err(  817):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err(  817):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
W/System.err(  817):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
W/System.err(  817):    at android.app.ActivityThread.access$1500(ActivityThread.java:121)
W/System.err(  817):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
W/System.err(  817):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  817):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  817):    at android.app.ActivityThread.main(ActivityThread.java:3701)
W/System.err(  817):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  817):    at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err(  817):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
W/System.err(  817):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
W/System.err(  817):    at dalvik.system.NativeStart.main(Native Method)
W/System.err(  817): Caused by: java.net.UnknownHostException: api.twitter.com
W/System.err(  817):    at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
W/System.err(  817):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
W/System.err(  817):    at java.net.InetAddress.getAllByName(InetAddress.java:256)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
W/System.err(  817):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:614)
W/System.err(  817):    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:162)
W/System.err(  817):    ... 19 more

Have anybody resolved this? I'm stuck here. I can get the code to run as a Java SE program, but it fails on android...

// Jonas

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

三生池水覆流年 2024-11-22 02:54:34

检查并确认两件事 -

1-在您在 Twitter 网站上创建的 Twitter 应用程序中提供回调 URL(转到您的应用程序 -> 设置 -> 回调 URL) 单击此处

2-转到手机设置,然后单击“日期和时间”并选择“自动”(请确保您的设备时间区和时间、日期均正确) 如果您的时间、日期和时区不正确,则您无法发推文。

Check and Confirm Two Things -

1-Give Callback URL in Your twitter app created by you on twitter website (Go to your app-> settings->callback url) Click here

2-Go to Phone settings then click 'Date and Time' and select 'Automatic' (Please make sure your device Time Zone and Time,Date all are correct) If your time,Date and Time Zone are not correct then you can not tweet.

╄→承喏 2024-11-22 02:54:34

我有一个在 Android 上使用 Twitter4J 为 Twitter 设置 OAuth 的教程< /a>,它还包括要下载的完整项目源代码 - 所以这可能会有所帮助。

至于您的具体问题 - 您可以通过 Android 模拟器连接到互联网吗?看起来好像无法连接 - 模拟器上是否有任何其他应用程序尝试连接互联网,您可以尝试和测试?有时,当我运行模拟器时,如果互联网连接失败,模拟器上的信号栏会出现一个 X,而没有信号栏。

I have a tutorial to setup OAuth for Twitter with Twitter4J on Android here, it includes the complete project source code to download as well - so that might help.

As for your specific issue - are you able to connect to the internet via the android emulator? it looks as though it is failing to connect - do you have any other apps on the emulator that attempt to connect the internet that you could try and test against? sometimes when I run the emulator if the internet connection fails then the signal bar on the emulator appears with an X by it and no-bars.

悍妇囚夫 2024-11-22 02:54:34

我在 Android 中使用 SignPost 专门用于 Twitter 客户端,工作正常。

  1. 您是否尝试过在 Android 中打开浏览器并访问 twitter.com?
  2. 尝试从代码连接到任何网址?

I've used SignPost in Android exactly for twitter client, works fine.

  1. Have you tried opening a browser in android and going to twitter.com?
  2. Try to connect to any url from the code?
明媚殇 2024-11-22 02:54:34

是的,我解决了(我在上面写过)。我弄乱了我的清单并将互联网许可拼写错误。时间

Yes, I solved it (I wrote that above). I had messed up my manifest and spelled the internet permission bad. T

吲‖鸣 2024-11-22 02:54:34

对我来说,我使用 http: 而不是 https: 作为请求 URI

for me i was using http: instead of https: for the request URI's

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文