1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Fixing documentation (SMACK-183).

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6947 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2007-02-04 18:50:38 +00:00 committed by matt
parent bf6471e76b
commit 2407d9e30f
2 changed files with 19 additions and 6 deletions

View file

@ -25,17 +25,24 @@ Smack Key Advantages
<ul>
<li>Extremely simple to use, yet powerful API. Sending a text message to a user
can be accomplished in three lines of code:
can be accomplished in only a few lines of code:
<div class="code"><pre>
XMPPConnection connection = <font color="navy"><b>new</b></font> XMPPConnection(<font color="green">"jabber.org"</font>);
connection.connect();
connection.login(<font color="green">"mtucker"</font>, <font color="green">"password"</font>);
connection.createChat(<font color="green">"jsmith@jivesoftware.com"</font>).sendMessage(<font color="green">"Howdy!"</font>);
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>);
</pre></div>
<li>Doesn't force you to code at the packet level, as other libraries do. Smack provides
intelligent higher level constructs such as the <tt>Chat</tt> and <tt>GroupChat</tt>
intelligent higher level constructs such as the <tt>Chat</tt> and <tt>Roster</tt>
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.
@ -65,7 +72,7 @@ use that as a reference while reading through this documentation.
<br clear="all" /><br><br>
<div class="footer">
Copyright &copy; Jive Software 2002-2005
Copyright &copy; Jive Software 2002-2007
</div>
</body>

View file

@ -49,8 +49,14 @@ import java.util.concurrent.CopyOnWriteArraySet;
* // Most servers require you to login before performing other tasks.
* con.login("jsmith", "mypass");
* // Start a new conversation with John Doe and send him a message.
* Chat chat = con.createChat("jdoe@jabber.org");
* chat.sendMessage("Hey, how's it going?");
* Chat chat = connection.getChatManager().createChat("jdoe@igniterealtime.org"</font>, new MessageListener() {
*
* public void processMessage(Chat chat, Message message) {
* // Print out any messages we get back to standard out.
* System.out.println(<font color="green">"Received message: "</font> + message);
* }
* });
* chat.sendMessage(<font color="green">"Howdy!"</font>);
* // Disconnect from the server
* con.disconnect();
* </pre>