5

ASmack library refers to the documentation at http://www.igniterealtime.org/builds/smack/docs/latest/documentation/index.html which I think it is outdated and does not provide accurate info. Examples are the following: - Debugging:

        XMPPConnection.DEBUG_ENABLED = true;

-- even in the latest Readme file, it is not working:

XMPPConnection.DEBUG

this is not working. - Also, ChatManager: 1st (in docs) is not working, 2nd after googling...

 ChatManager chatmanager = connection.getChatManager();

 ChatManager chatmanager = ChatManager.getInstanceFor(connection);

So how I can enable verbose debugging as this what I get in the log cat using the basic sample in the documentation:

05-26 11:15:11.237    4633-4633/com.ex.myapplication4.app W/System.err﹕ org.jivesoftware.smack.SmackException$ConnectionException
05-26 11:15:11.237    4633-4633/com.ex.myapplication4.app W/System.err﹕ at org.jivesoftware.smack.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:455)
05-26 11:15:11.237    4633-4633/com.ex.myapplication4.app W/System.err﹕ at org.jivesoftware.smack.XMPPTCPConnection.connect(XMPPTCPConnection.java:865)

And where I can find a reliable documentation or tutorial that works with the latest version (a)Smack 4.0.0-rc2 ?

aselims
  • 1,843
  • 1
  • 17
  • 19
  • 1
    I have the same problem like you. Today do you know where we can learn about asmack 4? – Dani Jun 16 '14 at 10:19
  • one possibility is to use asmack-android-7-beem-jingle.jar, It has been widely recovered and it works pretty well with my implementation. – aselims Jun 16 '14 at 13:01
  • Until asmack team publish asmack 4 docs, i am decide to continue using asmack-android-9-0.8.9 version. It's a shame but we can't doing nothing more... – Dani Jun 16 '14 at 20:11
  • 1
    Let's do something about it! Please, give us a documentation! A crowd documentation, this way we own could build based on our own experiences. – richardaum Jun 17 '14 at 15:20

2 Answers2

2

It doesn't answer your question.

But I was stucked on same (using aSmack 4.0 - asmack-android-8-4.0.0.jar):

06-17 13:42:22.466: W/System.err(16848): org.jivesoftware.smack.SmackException$ConnectionException
06-17 13:42:22.466: W/System.err(16848):    at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:431)
06-17 13:42:22.467: W/System.err(16848):    at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:799)
06-17 13:42:22.467: W/System.err(16848):    at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:391)

And I discovered what was the problem (if you want details please ask).

Does your connection is running on main thread? I solved that problem putting the code over AsyncTask, doInBackground method.

richardaum
  • 6,651
  • 12
  • 48
  • 64
  • I do not use Smack 4.0, I use Smack asmack-android-7-beem-jingle.jar and to a great extent it is working out. – aselims Jun 23 '14 at 13:47
  • 3
    You can get detailed debug info through: ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT); connConfig.setDebuggerEnabled(true); – aselims Jul 01 '14 at 08:46
0

I have used asmack-android-7-beem-jingle.jar for XMPP msgs over Android and it works pretty fine. I created a gist for the code I used: https://gist.github.com/aselims/92da8b2ad3692fdec699
I hope this helps!

aselims
  • 1,843
  • 1
  • 17
  • 19
  • That jar is 3 years old. The used Smack version contains security vulnerabilities. I recommend **not using it**. – Flow Dec 16 '14 at 11:23
  • I agree but it could be used for testing purposes as the latest smack does not have a proper documentation. – aselims Dec 17 '14 at 12:10
  • I dispute that "the latest smack does not have a proper documentation". See https://www.igniterealtime.org/builds/smack/docs/latest/documentation/ if you find errors in the documentation, then you should report those in the Smack Users forum: https://community.igniterealtime.org/welcome I'm sure the developers would be happy about every report. – Flow Dec 17 '14 at 13:54