简体   繁体   English

android 的 Openymsg

[英]Openymsg for android

I am developing YM client for Android.我正在为 Android 开发 YM 客户端。 I've included the openymsg0.5 api.我已经包含了 openymsg0.5 api。 When I run the program it shows following error.当我运行程序时,它显示以下错误。

06-29 11:32:04.097: ERROR/InputThread(11206): org.openymsg.network.LoginRefusedException: Login Failed, unable to retrieve stage 2 url
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.Session.yahooAuth16Stage2(Session.java:2048)
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.Session.yahooAuth16Stage1(Session.java:1955)
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.Session.receiveAuth(Session.java:1848)
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.InputThread.processPayload(InputThread.java:139)
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.InputThread.process(InputThread.java:129)
06-29 11:32:04.097: ERROR/InputThread(11206):     at org.openymsg.network.InputThread.run(InputThread.java:71)

This is the main error:这是主要错误:

LoginRefusedException: Login Failed, unable to retrieve stage 2 url

This question has been asked before but I haven't found an answer that has helped me.以前有人问过这个问题,但我没有找到对我有帮助的答案。 Does anyone have any idea about how to deal with this error?有谁知道如何处理这个错误? I have gone through the openymsg test code and code base and everything seems to be fine.我已经浏览了 openymsg 测试代码和代码库,一切似乎都很好。

I just checked, it works fine as a java application but if used as part of android it gives log in error.I am creating session as follows我刚刚检查过,它可以作为 java 应用程序正常工作,但如果用作 android 的一部分,则会出现登录错误。我正在创建 session,如下所示

Session session = new Session();
session.addSessionListener(new SessionListenerClass());
try{
    session.login("username", "password");
    if (session!=null 
        && session.getSessionStatus()== SessionState.LOGGED_ON) 
    {
        System.out.println("It logged on!!!!!!!");
    }
}

SessionListner:会话列表器:

public class SessionListenerClass extends SessionAdapter
{

    @Override
    public void messageReceived(SessionEvent event)
    {
        // TODO Auto-generated method stub
        super.messageReceived(event);
    }

    @Override
    public void notifyReceived(SessionNotifyEvent event)
    {
        // TODO Auto-generated method stub
        super.notifyReceived(event);
    }

    @Override
    public void newMailReceived(SessionNewMailEvent event)
    {
        // TODO Auto-generated method stub
        super.newMailReceived(event);
    }

    @Override
    public void errorPacketReceived(SessionErrorEvent event)
    {
        // TODO Auto-generated method stub
        super.errorPacketReceived(event);
    }

    @Override
    public void connectionClosed(SessionEvent event)
    {
        // TODO Auto-generated method stub
        super.connectionClosed(event);
    }

}

The library you're using is based on the jYMSG -library, which has a way better documentation.您正在使用的库基于jYMSG -library,它有更好的文档。

The Documentation for your thrown exception, theLoginRefusedException reads:您抛出的异常的文档LoginRefusedException内容如下:

Returns the status code given by the server.返回服务器给出的状态码。 This will one of the values specified in StatusConstants.这将是 StatusConstants 中指定的值之一。 Values will be either STATUS_BADUSERNAME for an unknown account, or STATUS_BAD for a bad password (or other fault).值将是未知帐户的 STATUS_BADUSERNAME,或密码错误(或其他故障)的 STATUS_BAD。

So you can check if it's "something else" or just a wrong username/password.因此,您可以检查它是“其他”还是错误的用户名/密码。


Okay, this seams to be a bug in the library.好的,这似乎是库中的一个错误。 I foundthis which shows that one of the project leaders knows about the problem.我发现表明项目负责人之一知道这个问题。 But I'm not sure if this will be fixed soon.但我不确定这是否会很快得到解决。

You should also notice, that the project is marked as "alpha".您还应该注意到,该项目被标记为“alpha”。 I can only suggest that you stay tuned for new releases which fix this issue.我只能建议您继续关注修复此问题的新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM