getSearchForm returns null when using UserSearch in XMPP with aSmack

Update 04/2014 The original answer below contains now old and outdated information. Since aSmack 0.8 it’s no longer necessary to manually configure the provider manager. Calling SmackAndroid.init(Context) as the aSmack README tells you to do, takes care of all necessary initializations. Original Answer In the end, the problem was global to all asmack. It seems … Read more

How to know Typing Status in XMPP openfire using Smack

To enable ChatStateListener you need to create a custom MessageListener Class public class MessageListenerImpl implements MessageListener,ChatStateListener { @Override public void processMessage(Chat arg0, Message arg1) { System.out.println(“Received message: ” + arg1); } @Override public void stateChanged(Chat arg0, ChatState arg1) { if (ChatState.composing.equals(arg1)) { Log.d(“Chat State”,arg0.getParticipant() + ” is typing..”); } else if (ChatState.gone.equals(arg1)) { Log.d(“Chat State”,arg0.getParticipant() … Read more

XMPP with Java Asmack library supporting X-FACEBOOK-PLATFORM

Finally, thanks to the no.good.at.coding code and the suggestion of harism, I’ve been able to connect to the Facebook chat. This code is the Mechanism for the Asmack library (the Smack port for Android). For the Smack library is necessary to use the no.good.at.coding mechanism. SASLXFacebookPlatformMechanism.java: import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.MessageDigest; import … Read more

Why am I getting java.lang.IllegalStateException “Not on FX application thread” on JavaFX?

The user interface cannot be directly updated from a non-application thread. Instead, use Platform.runLater(), with the logic inside the Runnable object. For example: Platform.runLater(new Runnable() { @Override public void run() { // Update UI here. } }); As a lambda expression: // Avoid throwing IllegalStateException by running from a non-JavaFX thread. Platform.runLater( () -> { … Read more