powered by Jive Software

Smack Project + Questions


Just like to say Smack is a great API, after trying to understand Jabber and other API’'s, SMACK has given me a better understanding of XMPP.WELL DONE JIVE!

Today I start my Project for my Final Year. My project is based on comparing XMPP and SIMPLE for Enterprise Instant Messenging. I will create 2 clients, the XMPP in Smack and the SIMPLE client using JAIN-SIP.

In due course I will be asking questions about Smack so please bear will my persistance.

My Initial Questions are:

1.Does anyone know if Smack is currently being used in a Enterprise Application?

2.Why do the developers of Smack use XMLPULL and dont use Xerces that is in Iain’'s book. Does XMLPULL have major advantages?


All the best for your project !

I can vouch for Smack and tell you that I am implementing a large enterprise project using Smack/XMPP for a purpose other than just IM, my verdict till now is that Smack rocks !!!

I cannot disclose the implementation details at the moment but Smack has made a lot of things work I’'m also sure that there are several other people building enterprise stuff using Smack.

I leave it to Matt,Gato,Iain to answer the parser question.


Thanks Rajesh.

I too believe Smack is a great API it seems to have simpler methods and constructs for development than other API’'s.

Rajesh, do you know if it is possible to implement Emoticons via Smack. Also are there anyways of retrieving message logs through Smack??? i.e…monitor a users conversation, or will I need to take the long route of programming through lower-level calls?


Dear Dilip,

Emoticons should notbe a problem, once you get the message text you can search for the presence of the emoticon strings and then replace them with images on the client. You have to make available the icons on the client and make a mapping between the emoticon string and the image.

As for logs, I assume that you want to store user conversations to a disk file ? You can open an FileOutputStream to write out the messages and close the file at the end of the conversation.

I beleive that Smack does not provide any out of the box facilities for this and ot does not have to either you have everything to do so

You need to plan and code your user interfaces properly to make all this work elegant.


2.Why do the developers of Smack use XMLPULL and dont

use Xerces that is in Iain’'s book. Does XMLPULL have

major advantages?

Pull parsing is much better suited for XMPP, as XMPP uses a single large, streaming XML document. None of the other XML parsing technologies can really handle large streaming docs correctly (although Xerces can do it if configured correctly). So, it’'s really just a matter of using the most elegant technology. There is also a new JSR that deals with pull parsing: http://dev2dev.bea.com/technologies/stax/index.jsp

Finally, the pull parsing library we use is very compact, which is nice for Smack since it allows the smack.jar to be quite small.



Thanks Matt and Rajesh

Rajesh, with opening a FileOutPutStream I would not be able to read the File until the conversation is closed. What I wanted to do was to monitor conversations as they happen (Real Time Messages). Any ideas on this?

Matt are there any File Transfer Supports on Smack? Cant see it in the docs? If not will future versions support it?

Dear Dilip

On receving a message display the message body on the UI and also write it out to a file, you have to work on this and build some robust code

Regarding file transports you have to look at the JEP and the various posts on this forum to get a clear picture.

I have experimented on doing IBB type file transfers using Smacks ability to attach Java objects to a message. Since all my end points are Smack based it works great !

I would suggest that you make a list of required features and then actually start coding each of them to know more on Smack and XMPP.


Thanks Rajesh.

I will try and get to grips with Smack, the API looks fairly straight forward, but my Java skills are not that good. Im more of a PHP person, but my University supervisor said their are a great deal of marks in this Enterprise Instant Messaging project. So I will try and implement some basic features like 1 to 1 chat and adding buddy lists, new users and a Swing GUI. I will hopefully then try some more complex stuff like emoticons and Chat Logs, if I get the simple stuff working!:frowning:

Anyway much to do, only 2 months left!aaahhhhh!