[jdev] regarding smack API
Trejkaz
trejkaz at trypticon.org
Wed Mar 23 02:58:23 CST 2005
On Wed, 23 Mar 2005 15:30, vimal kumar wrote:
> hi members,
> i have downloaded smack an API to communicate with jabber in java.
> Is It possible to develope shared whiteboard using smack API. since we
> have to complete our project reply soon.
There are a number of ways you might want to do this, but assuming you're
looking at something like this:
1. Users join a chat, or a groupchat
XMPPConnection.createChat(String)
2. User 1 draws a line:
2.1. User 1's client generates an XML extension describing the line.
** Custom XML extension required, but possible.
2.2. User 1's client wraps the XML extension in a message.
Message.addExtension(PacketExtension)
2.3. User 1's client sends the message to User 2's client.
Chat.sendMessage(Message)
2.4. User 2's client receives the message and unpacks the XML extension.
Message.getExtension(String,String)
2.5. User 2's client decodes the XML extension to obtain the line.
** Custom code again...
2.6. User 2's client draws the line.
...then you're fine.
If you're using a standard kind of extension layout, like this...
<x xmlns="http://example.com/protocols/whiteboard">
<value1> ... </value1>
<value2> ... </value2>
</x>
... then you can use DefaultPacketExtension and everything should work neatly.
If you want anything more than that, just be aware that Smack isn't quite as
easy to extend as, say, JSO.
TX
--
Email: Trejkaz Xaoza <trejkaz at trypticon.org>
Web site: http://trypticon.org/
Jabber ID: trejkaz at jabber.zim.net.au
GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F A62C B8C7 BC8B 037E EA73
More information about the JDev
mailing list