我正在尝试从我的Android应用程序发送直接信息。为此,我从链接中搜索并找到了以下解决方案。在那个Twitter4j中,我找到了代码片段。我在我的Android应用程序中也尝试过同样的方法,但问题是:
http://twitter4j.org/en/code-examples.html
// 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.**请帮我解决这个问题。
发布于 2012-10-10 15:40:35
错误消息说:
缺少身份验证凭据。
来自Twitter4J 代码示例页面:
要运行示例代码,需要在OAuth中配置twitter4j.properties凭据。有关细节,请参见Twitter4J -配置。
除非登录,否则不能在Twitter上发送直接消息(与其他一些特性不同,比如读取随机用户的状态更新)。在代码示例开始工作之前,您需要通过Twitter4J配置页面上提供的三种方法之一配置身份验证凭据。
https://stackoverflow.com/questions/12822976
复制相似问题