Android Twitter sendDirectMessages不工作

Android Twitter sendDirectMessages不工作,android,twitter4j,Android,Twitter4j,我正在尝试从我的Android应用程序发送直接消息。为此,我在谷歌上搜索并从链接中找到了以下解决方案。在Twitter4j中,我找到了代码片段。我在Android应用程序中也尝试过同样的方法,但遇到了问题: // The factory instance is re-useable and thread safe. Twitter sender = new TwitterFactory().getInstance(); DirectMessage message = sende

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

// 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.**

请帮助我解决此问题。

错误消息显示:

缺少身份验证凭据

从Twitter4J页面:

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


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

我在尝试将直接消息发送给关注者时遇到以下异常。10-11:21:45.930:W/System.err(11946):403:请求已被理解,但已被拒绝。附带的错误消息将解释原因。由于更新限制()而拒绝请求时使用此代码。10-11 11:21:45.930:W/System.err(11946):错误-您不能向未跟踪您的用户发送消息。