How to use smack with Openfire

newbie picture newbie · May 11, 2011 · Viewed 12.6k times · Source

Hi I am planning to develop a chat client which can connect to gtalk facebook etc...I have decided to use the smack API along with openfire..

But I need little guidance as to how to use it with openfire server..

And does the openfire provide a basic UI like log in box chat window etc...

I need to know how to plug or use smack with openfire

Thanks:)

Answer

Harry Joy picture Harry Joy · May 11, 2011

Configure openfire then refer to documentation provided by Smack. It has easy to understand examples. FYI openfire works fine with gtalk but with facebook it is very slow.


Sample code:-

ConnectionConfiguration config = new ConnectionConfiguration(host, 5222);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
connection.login(user_name, password);

Here host is the ip/domain name where openfire is configured.