powered by Jive Software

Registered User

There is a class called org.jivesoftware.smackAccountManager which allows you to create new accounts/register users in Jive messenger server.Suppose i want to check if a particular user is a registered how do i check the same?

There is another class called org.jivesoftware.smack.packet.Registration, but i aint sure how much help that would be to find out if particular user is a registered user or not.

Please advice

If you try to create a user that already exists, an XMPPException will be thrown - probably with error code 409.

Adam

When I failed creating an account, and if I want to solve this problem, can I only make some change in “catch". For example, after failing in creating an account, I need to pop up a dialog, but writing code in “catch” to pop up the Dialog is a wrong way. Then how can I know directly that I fail creating the account and why except by the mean of catching exception.

such as the following code:

HashMap hmap = new HashMap();

hmap.put(“email”, emailstr);

AccountManager acount = con.getAccountManager();

try{

acount.createAccount(idstr, pwdstr, hmap);

}catch(XMPPException xe){

xe.printStackTrace();

}

Please give me a specific answer with examples.

Many thanks!

I need to pop up a dialog, but writing code in “catch” to pop up the Dialog is a wrong way.

/code

Why is this the wrong way?

I have done it(popup a dialog) in the “catch” area!

Thank you, I am puzzled on the mean of writing code in “catch” for I never know people do in this way.now I understand!

Many thanks!