我对如何使用smack api注册用户一无所知。查看他们的文档并查看Registration
课程。我写了这段代码。但我想这不会注册用户。尽管代码运行良好,即没有错误或异常,但我没有看到数据库表填充了这些值。
Registration r = new Registration();
/*
* name -- the user's name.
first -- the user's first name.
last -- the user's last name.
email -- the user's email address.
city -- the user's city.
state -- the user's state.
zip -- the user's ZIP code.
phone -- the user's phone number.
url -- the user's website.
date -- the date the registration took place.
misc -- other miscellaneous information to associate with the account.
text -- textual information to associate with the account.
remove -- empty flag to remove account.
*/
Map<String,String> regAttr = new HashMap<String, String>();
regAttr.put("username", "suhail");
regAttr.put("first", "suhail");
regAttr.put("last", "gupta");
regAttr.put("email", "pqr@lmn.com");
regAttr.put("city", "ptk");
regAttr.put("state", "Punjab");
regAttr.put("zip", "145001");
regAttr.put("phone","9999");
regAttr.put("url", "www.abc.com");
regAttr.put("date", "14/8/2013");
regAttr.put("misc", "misc");
regAttr.put("text", "text");
regAttr.put("remove", "r");
r.setAttributes(regAttr);
如何使用smack api注册用户?