You should add a new user: go on openfire console and click users /
groups and then click on create new user.
After in your code:


         String host = "192.168.1.2";//Localhost
         String port = "5222";
         String service = "myserver.local";
         String username = "user";
         String password = "password";

        // Create a connection
        ConnectionConfiguration connConfig =new ConnectionConfiguration
(host, Integer.parseInt(port), service);
        XMPPConnection connection = new XMPPConnection(connConfig);

        try {
            connection.connect();

        } catch (XMPPException ex) {

            xmppClient.setConnection(null);
        }
        try {
            connection.login(username, password);

            // Set the status to available
            Presence presence = new Presence(Presence.Type.available);
            connection.sendPacket(presence);
            xmppClient.setConnection(connection);
        } catch (XMPPException ex) {

                xmppClient.setConnection(null);
        }



// Now return on Openfire Console and control if the user are
online.....

bye



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to