Skip to content

Instantly share code, notes, and snippets.

@Leaking
Created June 5, 2015 08:25
Show Gist options
  • Save Leaking/84f3b14d81e6aecb4dae to your computer and use it in GitHub Desktop.
Save Leaking/84f3b14d81e6aecb4dae to your computer and use it in GitHub Desktop.
smack4.1 usage
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
//.setUsernameAndPassword("peter", "123456")
.setServiceName("quinndemacbook-pro.local")
.setDebuggerEnabled(true)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setHost("10.180.145.92")
.setPort(5222)
.build();
conn = new XMPPTCPConnection(config);
new Thread(new Runnable() {
@Override
public void run() {
try {
conn.connect();
conn.login("peter","123456");
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment