Created
June 5, 2015 08:25
-
-
Save Leaking/84f3b14d81e6aecb4dae to your computer and use it in GitHub Desktop.
smack4.1 usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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