smack

Can I get online users in my friend list via Smack?

牧云@^-^@ 提交于 2019-12-17 22:54:02
问题 Can i get online users in my friend list via Smack API? Is it possible? I am working on app which have chat between users. I had successfully created chat application example just entering name of friend and send chat, but now I want online friends list. 回答1: Roster roster = xmppConnection.getRoster(); Collection<RosterEntry> entries = roster.getEntries(); Presence presence; for(RosterEntry entry : entries) { presence = roster.getPresence(entry.getUser()); System.out.println(entry.getUser());

Smack API - Read Chat History from Openfire Server

只愿长相守 提交于 2019-12-17 18:33:48
问题 How can I fetch chat log or chat history from Openfire server using Smack library into an Android application? 回答1: As far as I know, there is no storing of chat history in Openfire. You can only get offline messages sent by user (when they connect next time for example), but if you want to store the messages you can implement it yourself directly on the XMPP server (personally I did it using mongodb - it works great!). But then, maybe I missed something in Openfire... 回答2: Openfire server

Voice chat application using Smack API

邮差的信 提交于 2019-12-14 03:59:35
问题 I'm currently developing an IM application in java using the Smack API. I've had no issues coding the simple functionalities such as instant messaging, group chat, and file sharing since there are plenty of online resources regarding the Smack API. I'm running this through an OpenFire server and connecting to a Spark client for testing purposes. All done locally so far. My problem is to do with Jingle, or just getting voice chat established somehow. Are there any resources to help get me

Initialization exception “NoClassDefFoundError: javax.naming.directory.InitialDirContext” when using Smack 4.1 on Android

…衆ロ難τιáo~ 提交于 2019-12-14 03:46:54
问题 I am trying to use Smack for my project. I have previously used aSmack in some of my earlier projects which worked really well. However Smack is giving me weird exceptions. Here's my initialization code looks like - public void init(String username, String password) throws IOException, XMPPException, SmackException { mConnection = new XMPPTCPConnection(username, password, HOST_NAME); //This is the line which generates the exception mConnection.connect(); mConnection.login(); mChatManager =

Create MUC group like whatsapp Android

痴心易碎 提交于 2019-12-14 03:33:29
问题 I can creating and joining MUC rooms. But user disconnects from the Openfire server, he is removed from the group on the server side. How can i similar to what Whatsapp does, i.e. even if the user goes offline, he is still part of the MUC room (which is configured to be persistent on the server side) and will receive messages from other occupants. 回答1: When inviting an user, you have to grant him Membership: MultiUserChat muc = multiUserChatManager.getMultiUserChat("foo@conference.myserver");

Can't able to receive group chat messages using smack-android:4.1.4

岁酱吖の 提交于 2019-12-14 02:08:55
问题 I am developing chat app using smack library. I have an issue in group chat. In my app, i am creating a group and in that members are auto-joined.i want to notify all user when I send a message in the group even if they had not initiated a chat.My code is as follow in that I have place listener in init method but unable to receive a message. multiUserChatManager = MultiUserChatManager.getInstanceFor(mConnection); mMultiUserChat = multiUserChatManager.getMultiUserChat(to); mConnection

Openfire chatting unexpected behavior

橙三吉。 提交于 2019-12-13 22:25:02
问题 We have used Openfire chatting with Android and iOS applications and all things are working perfectly before, but we are facing some unexpected behavior in chatting right now, like messages are taking more time to send and receive. Our app is live. I am sharing Openfire server debug and error logs and some screenshots. How can I find out what exactly issue happening with server and what could be the solution to resolve this issue? Also getting some error log from server. org.jivesoftware

XMPP client for Quickblox using Smack

怎甘沉沦 提交于 2019-12-13 18:59:11
问题 I'm trying to write a XMPP client to connect to Quickblox and use it as a bot for a chat application. I'm using Smack 4.1.3 for this purpose. Here's my code: public static void sendChat1() { XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() .setUsernameAndPassword("4461610-26179", "pass") .setServiceName("chat.quickblox.com") .setPort(5222) .build(); System.out.println("Establishing Connection"); AbstractXMPPConnection conn2 = new XMPPTCPConnection(config); try

smack connection using servlets

坚强是说给别人听的谎言 提交于 2019-12-13 12:51:34
问题 Here I am connecting to facebook using smack and servlets ,I can able to send and receive chat messages. But here connection object is instance variable(not thread-safe),so all the users are getting same connection object. If we declare XMPPConnection object inside doGet() method we have to take connection every time when the user send chat message. provide some solution for my problem. public class Home_page_action extends HttpServlet implements MessageListener{ public XMPPConnection

read incoming Message packets in pubsub using smack

。_饼干妹妹 提交于 2019-12-13 11:52:29
问题 i am trying to implement pubsub using openfire server and asmack library. i have configured my node in such a way that subscribers has to take the approval of publishers now i am trying to read the Message packet using following code but i am not getting any packet. i want to read Message packet because i want to know whenever the subscribers send the request to publishers to get subscribe. PacketTypeFilter filter = new PacketTypeFilter(org.jivesoftware.smack.packet.Message.class);