java - XMPP register new user -


i having lots of trouble xmpp, new , examples have found have account connect , things.

my problem concerns new users. not have account needs able register himself , log in. have understood, first need create connection before can create users. without account can not create one.

some links have been reading:

http://alvinalexander.com/java/jwarehouse/eclipse/platform-ui-home/eclipsecon/tutorial/example2/org.jivesoftware.smack/src/org/jivesoftware/smack/accountmanager.java.shtml

https://code.google.com/p/lxmppd/issues/detail?id=328

https://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/

http://www.igniterealtime.org/builds/smack/dailybuilds/documentation/connections.html

https://gist.github.com/mindjiver/1605194

so basically, need create connection without user login. create user , login user.

so found this:

how register new user on xmpp using (a)smack library

but seems accountmanager class outdated or because cannot find in same path. (http://www.igniterealtime.org/builds/smack/docs/4.0.6/javadoc/org/jivesoftware/smack/accountmanager.html)

so question is: how create new account , login it(from new users perspective)?

a small code snippet or link source highly appreciated.

edit 1: have gotten point:

        xmpptcpconnectionconfiguration config = xmpptcpconnectionconfiguration.builder()                 .setservicename("jabber.org")                 .sethost(appconfig.xmpp_host)                 .setport(integer.parseint(appconfig.xmpp_port))                 .build();          xmppconnection connection = new xmpptcpconnection(config); 

now need instantiate accountmanager object not available in smack 4.1

i trying follow example: how create account smack 4.1

and though read should in smackx. thing can find in smackx is:

import org.jivesoftware.smackx.debugger.android.androiddebugger 

creating account works first connecting server , then initializing account creation. essentially, create connection in can create account, , proceed create said account. here's how it:

xmpptcpconnectionconfiguration conf = xmpptcpconnectionconfiguration.builder()             .setservicename(service_name)             .sethost(host_name)             .setport(5222)             .setsecuritymode(connectionconfiguration.securitymode.disabled)             .build();  abstractxmppconnection connection = new xmpptcpconnection(conf); connection.connect(); // here create connection  // create account: accountmanager accountmanager = accountmanager.getinstance(connection); accountmanager.createaccount(username, password);  // account has been created, can login connection.login(username, password); 

so first initialized connection, created account, , logged in. helps


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -