Connect Openfire server to Android Application

Hi ,

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 :

http://developer.samsung.com/android/technical-docs/Building-a-Chat-Application

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 the error message said that the server was not connected.

Based on the result , I had researched to solve the problem.

I had found on the web (http://stackoverflow.com/questions/6804236/why-cant-i-connect-to-the-openfire-se rver) 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 not able to work while my ip address able to work?

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.

Please advice.

Thank you.