How to programmatically register on xmpp server:
https://stackoverflow.com/questions/29003160/create-the-new-user-in-xmpp-account-programmatically-in-androidFirst of all remove these lines you don't need to login to create an account.
connection.login("admin", "admin");
Log.i("XMPPChatDemoActivity","Logged in as " + connection.getUser());
String kk= connection.getUser();
And also keep either below code
Registration registration = new Registration();
registration.setType(IQ.Type.SET);
registration.setTo(connection.getServiceName());
PacketFilter filter = new AndFilter(new PacketIDFilter(registration.getPacketID()), new PacketTypeFilter(IQ.class));
PacketCollector collector = connection.createPacketCollector(filter);
connection.sendPacket(registration);
connection.disconnect();
Or this
AccountManager accountManager = connection.getAccountManager();
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("Username", username);
attributes.put("Name", name);
attributes.put("Email", email_id);
attributes.put("Password", password);
attributes.put("Confirm Password", cmpassword);
accountManager.createAccount("45.56.87.223","5222",attributes);
As both codes can be used for registartion.You don't need both of these codes to register a user.Use any one of them.And you are done.
And also check from the openfire settings that nband Account Registration is enabled.Hope it will help.Thanks.
List of free xmpp servers:
https://list.jabber.at/Free clients for xmpp:
https://xmpp.org/software/clients/Windows:Gajim Linux / Windows
Android:Conversations Android
https://github.com/inputmice/ConversationsiOS: Profanity Linux / macOS / Windows
https://profanity-im.github.io/Mac:Profanity Linux / macOS / Windows
https://profanity-im.github.io/Linux:https://gajim.org/
https://astrachat.com/ works for all Mac, Win, Android, Linux and iOS.
https://pidgin.im/pidgin chat client for xmpp for windows
https://adium.im/ for MacOS
Prosody xmpp server
https://www.ejabberd.im/ Windows client for XMPP