librelist archives

« back to archive

HowTo setConnectionLogger in Android??

HowTo setConnectionLogger in Android??

From:
Howard Schmaeu
Date:
2015-04-27 @ 10:46
can you help me please?
i try to setConnectionLogger in your Android Sample App like this:

....
private MessagesSyncManager() {
        session = new IMAPSession();

        //GMail
        session.setUsername("****@gmail.com");
        session.setPassword("*****");
        session.setHostname("imap.gmail.com");
        session.setPort(993);
        session.setConnectionType(ConnectionType.ConnectionTypeTLS);

        Logger logger = new Logger() {
            @Override
            public void log(long l, int i, byte[] bytes) {
                ....
            }
        };

        session.setConnectionLogger(logger);
}

public abstract class Logger implements ConnectionLogger{
        public abstract void log(long l, int i, byte[] bytes);
}

BUT i got an Exception:

JNI DETECTED ERROR IN APPLICATION: JNI GetObjectField called with
pending exception 'java.lang.NoSuchFieldError' thrown in void
com.libmailcore.IMAPSession.setupNativeConnectionLogger():-2
in call to GetObjectField from void
com.libmailcore.IMAPSession.setupNativeConnectionLogger()