I'm new to Openfire server so I'm not very sure on how to use it. I'm trying to connect the server to an Android application which I had found on the web :
From the code , there is a host , port , username and password. I tried input the following: host : 127.0.0.1 port : 5222
However , the result of the application had failed which stated the error message that the server was not connected.
I had found on the web (Why can't I connect to the openfire server?) which the methods stated to edit the openfire.xml file. I had edited the file and the host number from the code into my ip address and it manage to work.
I'm just wondering why doesn't the original server ip address (127.0.0.1) not able to work while my ip address able to work?I'm also not sure if this problem only applicable to me alone.
Currently , I'm using emulator from Eclipse to run the application. But i believe in the future I will faced this issue again as I doubt using my own IP address able to work in the phone.
Edited : I understand that Emulator needed network connection to connect to Openfire server which is why I have to change.
Currently my doubt is how to change the code to such that my application is able to connect and send messages via Openfire on mobile phone devices ? I had tried searching solution but I couldn't find any. One solution I found in this website was to put the connection part of the code in AsyncTask. Is this true ?