3
votes

I am trying to develop XMPP chat in Android and while creating new user using AccountManager I am having the following exception :

jid-malformed(400)

My user-connection code goes like this:

AccountManager manager = connection.getAccountManager();
try {
      manager.createAccount(username, password);
}
catch(XMPPException e){
   e..printStackTrace();
}

here my

username = [email protected]  
password = 12345678

I learned that we need not require to send service name with the username from post

But in my username the format says that my user is "abc" and my service is "xyz.com"

what should I do to keep '@' in my username?

Thank You. :)

1
check this link link, it seems it worked for that guydhpratik

1 Answers

3
votes

JID escaping is done as per XEP-0106. Specifically, the "@" character should be replaced by "\40" to keep the "@" as part of the JID.