powered by Jive Software

Create a Simple Instant Messenger

Hi

Im fairly new at Jabber.Im finding it very hard to construct a simple Jabber Client. Can anyone give me some hints on creating one that just sends a simple message to a jabber user. Im not worried about rosters or special features, I just want to type in a users name and send a simple message!

Please Help!

Dear Dilip

Creating a simple messaging system using Smack is easy and you can build clean code too.

You can get plenty of tips on this site itself, the home page of smack itself shows you how a message could be sent using about 3 lines of code !

I would advice you to read through the documentation available on this site at http://www.jivesoftware.com/xmpp/smack/documentation/

You could leave out the roster and extensions for now. Reading through the documents should give you most of the building blocks.

I presume that you are comfortable with Java. You could go like :

1.Create two user accounts on a public jabber server.

2.Download smack and ensure that smack.jar is on your classpath.

3.Try out command line clients to connect to the jabber server and send out messages and also receive them.

4.Develop a simple UI to allow typing and sending of messages.

Hope this helps and please get started and keep posting on your progress so that more help could be provided as you go.

-Rajesh

Thanks Rajesh!I am in the progress of reading the docs!I will then try and send some simple command line messages!I will report my progress for others to see!

Thanks

Dilip

hi dilip

r u trying to connect to jabber.org server or ur connecting to a local server.which one do u think is easier ?

if ur using a local one which one r u using ? i’‘m planning for openIM but i’'ve some problem configuring it.

did u try ??

bye

bobby

bobby,

r u trying to connect to jabber.org server

.org server or ur connecting to a local server.which

one do u think is easier ?

From Smack perspective it’'s the same (i.e. easy) to connect to any XMPP server (as long as the XMPP server correctly implements the XMPP spec). Are you having any problem trying to connect?

if ur using a local one which one r u using ? i’'m

planning for openIM but i’'ve some problem configuring

it.

You can try Jive Messenger which is very easy to install and use. You can download it from http://www.jivesoftware.com/downloads.jsp.

Regards,

– Gato

hi Gato

thanx for the info.i’‘ve downloaded the jive messenger and also smack api also.I’'m writing the following code to connect to the server.

import org.jivesoftware.smack.*;

public class connector {

public static void main(String[] args) {

try {

XMPPConnection connection = new XMPPConnection(“localhost”, 5222);

connection.login(“XXX”,“XXX”);

} catch (Exception e) {

System.out.println(“Failed”);

}

}

}

i’‘ve some problem here.is it correct to use localhost.my jive messenger id running when i’'ve run the prgm.

where do u think is the problem ??

bye

Bobby

Please see my comments at

-Rajesh