Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. username = "admin";
  2. password = "admin";
  3. port = "5222";
  4. serviceName = "davids-macbook-pro.local";
  5. host = "192.168.20.8";
  6.  
  7. config = XMPPTCPConnectionConfiguration.builder()
  8. .setUsernameAndPassword(username, password)
  9. .setHost(host)
  10. .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
  11. .setServiceName(serviceName)
  12. .setPort(Integer.parseInt(port))
  13. .build();
  14.  
  15. connection = new XMPPTCPConnection(config);
  16. try {
  17. connection.connect();
  18. connection.login();
  19. } catch (SmackException e) {
  20. e.printStackTrace();
  21. } catch (IOException e) {
  22. e.printStackTrace();
  23. } catch (XMPPException e) {
  24. e.printStackTrace();
  25. }
  26.  
  27. Roster roster = Roster.getInstanceFor(connection);
  28. Collection<RosterEntry> entries = roster.getEntries();
  29. Log.i("entry", entries);
  30. for (RosterEntry entry : entries) {
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement