powered by Jive Software

How are create Group via Smack API?

Step 1: getRoster()

XMPPConnection connection;

try {

connection = new XMPPConnection(“haopu”);

roster = connection.getRoster();

//if (XMPPConnection.DEBUG_ENABLED) {

System.out.println(connection.getRoster().getEntries());

//}

} catch (XMPPException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Step 2: create group .

if (roster != null) {

rosterGroup = roster.createGroup(name);

isOk = true;

} else {

throw new UnsupportedOperationException(

“connection is null. IRosterImpl.class”);

}

now , running , but roster is null ?

can we show new group in admin console of JIVE ?

Thanks in advance for any help!

you need to have a RosterEntry inside of the RosterGroup.