5

I want to make a small chat application in Android. For this i done steps mentioned in this following page

http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/

Its working fine if we enter gmail credentials like as :-

private final static String SERVER_HOST = "talk.google.com";
private final static int SERVER_PORT = 5222;
private final static String SERVICE_NAME = "gmail.com"; 
private final static String LOGIN = "myemail@gmail.com";
private final static String PASSWORD = "mypassword";

But i want to use my own server in place of gmail. I installed openfire in my system, and i am very fresher in openfire , please suggest me what entries should i do for above credential if i am using my own server.

If any query then please feel free to ask, i am always here.. Thank you in advance.

Pushpendra Kuntal
  • 6,118
  • 20
  • 69
  • 119

1 Answers1

4

server_host and login/service_name.

server_host is the server you connect to, login is <something> @ service_name, which should match the declared service name for you server (possibly matches server_host or last part of server_host)

so if your server is xmpp.example.com, changes are your entries should most likely be

SERVER_HOST = "xmpp.example.com"
SERVICE_NAME = "example.com"
LOGIN =  "johndoe@example.com"

or

SERVER_HOST = "xmpp.example.com"
SERVICE_NAME = "xmpp.example.com"
LOGIN = "johndoe@xmpp.example.com"

and obviously, have the port match the port you run openfire on (5222 is the default value)

njzk2
  • 38,969
  • 7
  • 69
  • 107