I am trying to create a XMPP chat client using aSmack library for android.I am using openfire server that runs on localhost. I am creating a XMPPConnection and logging in the user successfully but when I try to create a new roster entry for that connection it throws an internal server error
Presence presence = new Presence(Presence.Type.subscribe);
presence.setTo(requestedUser);
connection.sendPacket(presence);
try {
roster.createEntry(requestedUser+"@123", "nickname", null);
} catch (XMPPException e) {
Log.e("exception", e.getMessage().toString());
}
Through this piece of code I am trying to send a friend request to another user.