0

I am trying to create a room for MultiUserChat in android. Here is my attempt:

String mNickName = "7799963";
String mGroupChatName = "room@confrence.mytestserver.net"; // Room Name
MultiUserChat mMultiUserChat;

mMultiUserChat = new MultiUserChat(mXMPPConnection, mGroupChatName);
try {

    mMultiUserChat.create(mNickName);
    mMultiUserChat.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
    mMultiUserChat.join(mNickName);
} catch (XMPPException e) {

    e.printStackTrace();
}

But i am getting no response , here is my logcat:

11-23 15:58:54.580: W/System.err(16749): No response from server.: 
11-23 15:58:54.610: W/System.err(16749):    at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:359)

Can anyone guide me where m mistaken or any solution?

4

1 回答 1

0
final MultiUserChat muc = new MultiUserChat(connection, roomsName+ "@conference." + connection.getServiceName());    

// The number of chat room services will decide to accept the
// historical record
// muc.create(roomsName);

DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(0);
// history.setSince(new Date());
// Users to join in the chat room
// if (user.equals("meet")) {
// muc.invite("Kishan@54.76.159.35", "Invitation From Rajan");
muc.join(user, password, history,
    SmackConfiguration.getPacketReplyTimeout());

在此代码中,您必须添加:

  1. 连接实例。
  2. 自定义房间名称。

我能够在开火中创建组。

于 2015-01-09T06:06:51.210 回答