首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Twitter sendDirectMessages不工作

Android Twitter sendDirectMessages不工作
EN

Stack Overflow用户
提问于 2012-10-10 15:27:10
回答 1查看 795关注 0票数 0

我正在尝试从我的Android应用程序发送直接信息。为此,我从链接中搜索并找到了以下解决方案。在那个Twitter4j中,我找到了代码片段。我在我的Android应用程序中也尝试过同样的方法,但问题是:

http://twitter4j.org/en/code-examples.html

代码语言:javascript
复制
// The factory instance is re-useable and thread safe.
    Twitter sender = new TwitterFactory().getInstance();
    DirectMessage message = sender.sendDirectMessage(recipientId, message);
    System.out.println("Sent: " message.getText() + " to @" + message.getRecipientScreenName());


Issue :
**10-10 20:04:26.440: E/AndroidRuntime(6935): java.lang.IllegalStateException: Authentication credentials are missing. See http://twitter4j.org/configuration.html for the detail.**

请帮我解决这个问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-10 15:40:35

错误消息说:

缺少身份验证凭据。

来自Twitter4J 代码示例页面:

要运行示例代码,需要在OAuth中配置twitter4j.properties凭据。有关细节,请参见Twitter4J -配置

除非登录,否则不能在Twitter上发送直接消息(与其他一些特性不同,比如读取随机用户的状态更新)。在代码示例开始工作之前,您需要通过Twitter4J配置页面上提供的三种方法之一配置身份验证凭据。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12822976

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档