我想使用Android的smack API來開發一個使用Gmail帳戶的聊天室。我設法創建了一個房間並向羣組發送消息。但是當有人回覆我無法直接在聊天窗口或通過程序(muc.addMessageListener(myMessageListener)和PacketListener)接收傳入消息時。無法接收聊天消息使用smackx MultiUserChat API
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com"); config.setSASLAuthenticationEnabled(true); connection = new XMPPConnection(config); connection.connect(); connection.login("[email protected]", "password"); muc = new MultiUserChat(connection, "[email protected]le.com"); muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT)); muc.join("kandroid6990"); muc.invite("[email protected]/User1", "Welcome!"); muc.invite("[email protected]/User2", "Welcome!");
Message msg = new Message("[email protected]le.com", Message.Type.groupchat); msg.addBody(Message.getDefaultLanguage(), messageText); muc.sendMessage(msg);
你通過得到你的答案 – Lokesh 2014-10-18 17:11:05