Question

I am working on group chat in android using asmack library. I am able to chat with single user but getting problems in group chat. I require any tutorial or code to perform group chat.

I've referenced this Stack Overflow question and this blog post when looking for a solution.

Was it helpful?

Solution

public void MUC_Configure(String roomname){

    try{
        muc = new MultiUserChat(XMPPSmackConnection.connection, roomname+Constant._hostNameWithCONF);
        muc.create("nickname1");

        // Send an empty room configuration form which indicates that we want an instant room
        muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

        muc.join("nickname1");
        muc.invite("column1"+Constant._hostNameWithAt+"/Smack", "Meet me in this excellent room");
        muc.addInvitationRejectionListener(this);
        muc.addMessageListener(this);
    }catch (Exception e) {
        e.printStackTrace();
    }       
}

Finally I done with the above method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top