詳しくは以下の公式ドキュメントを参照するとよいでしょう。
まず中心となるのはXMPPConnectionクラスになる。
namespaceのorg.jivesoftware.smackは省略してあります。
SYNOPSIS
ConnectionConfiguration config = new ConnectionConfiguration(host, port, domain);
XMPPConnection conn = new XMPPConnection(conf);
conn.connect();
conn.login(user, pass);
if (conn.isAuthenticated()) {
}
conn.disconnect();
スタンザの送信は次のようにsendPacketを利用して行うことが出来る。
SYNOPSISconn.sendPacket(new Presence(Presence.Type.available, "status", priority, Presence.Mode.available));
詳しくは以下の公式ドキュメントを参照するとよいでしょう。
MutiUserChat muc = new MultiUserChat(connection, "roomname@muc.example.org");
muc.create("roomnick");
muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
SYNOPSIS
muc.join('nick');
muc.addInvitationRejectionListener(new InvitationRejectionListener(){
public void invitationDeclined(String invitee, String reason) {}
});
MultiUserChat.addInvitationListener(conn, new InvitationListener(){
public void invitationReceived(Connection conn, String room, String inviter, String reason, String password) {
MultiUserChat.decline(conn, room, inviter, "busy");
}
});