Application based on qxmpp can't connect to server on Android, but working well on windows

260 Views Asked by At

I'm using qxmpp library in my project. I've tried to write simple app to find out if it connects to server. It connects on Windows well. Then I've tried to test it on Android, but it doesn't connect and I don't know why because it shows no error.

The app running correctly on Android, but it seems nothing is going on about XMPP protocol. No connection and logging. All I got in debug() just this one line:

D/libc-netbsd(  465): getaddrinfo: gmail.com get result from proxy >>

This is my first try:

lbl.setText("is not Connected");
client.connectToServer("[email protected]", "asdasd");
while(!(client.isConnected())){
    a.processEvents();
}
lbl.setText("Connected");

it does connect but just on Windows. I've tried the GuiClient project, both of them seems not working.

I changed this line

DEFINES +=  QXMPP_LIBRARY_TYPE=staticlib

to

DEFINES +=  QXMPP_LIBRARY_TYPE=shared

and build libqxmpp.so but nothing again.

I wrote these lines in my application's .pro file for adding library to my project.

CONFIG(debug, debug|release) {
    win32{
        QXMPP_LIBRARY_NAME_INC = qxmpp_d0
    } else {
        QXMPP_LIBRARY_NAME_INC = qxmpp_d
    }
}else{
    win32{
        QXMPP_LIBRARY_NAME_INC = qxmpp0
    }else{
        QXMPP_LIBRARY_NAME_INC = qxmpp
    }
}
LIBS += -L./qxmpp/src -l$$QXMPP_LIBRARY_NAME_INC

Thanks in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

That was because of QDnsLookup was not developed for Android. And i pass this problem by using IP address of my own servers. (Its didn't work by Google servers using ip address)