Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XMPP jid-malformed(400) error Android while creating user

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. :)

like image 694
codemaniac Avatar asked Feb 11 '26 10:02

codemaniac


1 Answers

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

like image 60
Kedar Paranjape Avatar answered Feb 18 '26 01:02

Kedar Paranjape



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!