Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASmack - Where to get ChatManager from?

Tags:

android

asmack

I am trying to make a small XMPP-capable chat application for a school project using aSmack-8-4-rc2 on Android 4.2.2, and I am having issues getting a ChatManager object to process incoming messages.

Every example I have seen so far does

ChatManager manager = connection.getChatManager();

However, it seems that at some point during development, the function getChatManager() was either removed or replaced from class XMPPConnection (or XMPPTCPConnection, since the former seems to have been deprecated), and I am unable to find ANY documentation or examples that give me any indication of what replacements I can get.

I tried using constructors from the class ChatManager. It does appear to have a constructor, albeit a private one and I am therefore unable to create the object. I am assuming it is intended to be a singleton, but I have yet to find a way to get to it.

Does anybody know where was this function moved to?

like image 820
rubbyrubber Avatar asked May 26 '14 01:05

rubbyrubber


1 Answers

Just found it. Leaving it here for future reference:

ChatManager chatManager = ChatManager.getInstanceFor(connection);
like image 133
rubbyrubber Avatar answered Oct 20 '22 05:10

rubbyrubber