开发者

Openymsg for android

开发者 https://www.devze.com 2023-03-16 12:42 出处:网络
I am developing YM client for Android. I\'ve included the openymsg0.5 api. When I run the program it shows following error.

I am developing YM client for Android. I've included the 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.

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

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.

The Documentation for your thrown exception, the LoginRefusedException reads:

Returns the status code given by the server. This will one of the values specified in StatusConstants. Values will be either STATUS_BADUSERNAME for an unknown account, or STATUS_BAD for a bad password (or other fault).

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 found this 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". I can only suggest that you stay tuned for new releases which fix this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消