2003-01-15 16:03:36 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Smack: Overview - Jive Software</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="header">
|
|
|
|
Smack Overview
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="nav">
|
|
|
|
« <a href="index.html">Table of Contents</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
2007-03-01 02:51:12 +01:00
|
|
|
Smack is a library for communicating with XMPP servers to perform real-time communications, including
|
|
|
|
instant messaging and group chat.<p>
|
2003-01-15 16:03:36 +01:00
|
|
|
|
|
|
|
<p class="subheader">
|
2003-06-19 20:11:37 +02:00
|
|
|
Smack Key Advantages
|
2003-01-15 16:03:36 +01:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>Extremely simple to use, yet powerful API. Sending a text message to a user
|
2007-02-04 19:50:38 +01:00
|
|
|
can be accomplished in only a few lines of code:
|
2003-01-15 16:03:36 +01:00
|
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
|
XMPPConnection connection = <font color="navy"><b>new</b></font> XMPPConnection(<font color="green">"jabber.org"</font>);
|
2007-02-04 19:50:38 +01:00
|
|
|
connection.connect();
|
2003-01-15 16:03:36 +01:00
|
|
|
connection.login(<font color="green">"mtucker"</font>, <font color="green">"password"</font>);
|
2007-02-04 19:50:38 +01:00
|
|
|
Chat chat = connection.getChatManager().createChat(<font color="green">"jsmith@jivesoftware.com"</font>, new MessageListener() {
|
|
|
|
|
|
|
|
public void processMessage(Chat chat, Message message) {
|
|
|
|
System.out.println(<font color="green">"Received message: "</font> + message);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
chat.sendMessage(<font color="green">"Howdy!"</font>);
|
2003-01-15 16:03:36 +01:00
|
|
|
</pre></div>
|
|
|
|
|
|
|
|
|
|
|
|
<li>Doesn't force you to code at the packet level, as other libraries do. Smack provides
|
2007-02-04 19:50:38 +01:00
|
|
|
intelligent higher level constructs such as the <tt>Chat</tt> and <tt>Roster</tt>
|
2003-01-15 16:03:36 +01:00
|
|
|
classes, which let you program more efficiently.
|
|
|
|
|
|
|
|
<li>Does not require that you're familiar with the XMPP XML format, or even that you're familiar with XML.
|
|
|
|
|
|
|
|
<li>Provides easy machine to machine communication. Smack lets you set any number of properties on
|
|
|
|
each message, including properties that are Java objects.
|
|
|
|
|
|
|
|
<li>Open Source under the Apache License, which means you can incorporate Smack into your commercial or
|
|
|
|
non-commercial applications.
|
|
|
|
</ul>
|
|
|
|
|
2003-06-19 20:11:37 +02:00
|
|
|
<p class="subheader">
|
|
|
|
About XMPP
|
|
|
|
</p>
|
|
|
|
|
2007-03-01 02:51:12 +01:00
|
|
|
XMPP (eXtensible Messaging and Presence Protocol) is an open protocol standardized by the IETF
|
|
|
|
and supported and extended by the XMPP Standards Foundation
|
|
|
|
((<a href="http://www.jabber.org">http://www.xmpp.org</a>).
|
2003-08-19 15:22:31 +02:00
|
|
|
|
|
|
|
<p class="subheader">
|
|
|
|
How To Use This Documentation
|
|
|
|
</p>
|
2003-06-19 20:11:37 +02:00
|
|
|
|
2003-08-19 15:22:31 +02:00
|
|
|
This documentation assumes that you're already familiar with the main features of XMPP
|
|
|
|
instant messaging. It's also highly recommended that you open the Javadoc API guide and
|
|
|
|
use that as a reference while reading through this documentation.
|
|
|
|
|
2003-06-19 20:11:37 +02:00
|
|
|
<br clear="all" /><br><br>
|
2003-01-15 16:03:36 +01:00
|
|
|
<div class="footer">
|
2008-11-03 17:28:57 +01:00
|
|
|
Copyright © Jive Software 2002-2008
|
2003-01-15 16:03:36 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|