I´ve installed smack successfully on my system. And want to connect to a server. After this I have used a username and password to login(not really existing). Now my questions:
How can i get an account? Or stores the server an account if he haven´t the username in database?
Can anyone tell me the problem with the code, or better: give me an example?
Iýve installed smack successfully on my system. And
want to connect to a server. After this I have used a
username and password to login(not really existing).
Now my questions:
How can i get an account? Or stores the server an
account if he havenýt the username in database?
The Smack API (and someone correct me if I’‘m wrong) currently is not setup to handle registration in an easy manner, so creating a new account on a server is going to be difficult. If you’'re going to be doing a lot of Jabber work you should look into setting up your own Jabber server. Look here http://www.jabber.org/admin/serverlist.php there are a couple of open-source Jabber server solutions available and a couple of commerical ones are free if you have less than 5 clients.
Can anyone tell me the problem with the code, or
better: give me an example?
Once you get an account setup try using this little snippet of code:
import org.jivesoftware.smack.*; public class SmackTest { private String jHost = "myjabberserver";
private XMPPConnection connection = null; public SmackTest() {
try {
connection = getConnection(jHost); connection.login("user1", "test");
connection.createChat("user2@myjabberserver").sendMessage("Howdy!"); } catch (Exception ex) {
ex.printStackTrace();
}
} private XMPPConnection getConnection(String host) throws XMPPException {
XMPPConnection.DEBUG_ENABLED = true;
return new XMPPConnection(host);
} public static void main(String[] args) {
new SmackTest();
}
}
It’‘s just a slight extension of the code that can be found on Smack’'s home page. Once you get that running start adding little things, like taking input from the console, adding a little GUI, etc.
By the way, JabberD server (for Win32, IMHO in *NIX versions there are the same) with default settings requires only user login and password for registration.
So basic registration support implementation wouldnt take much time.
Registration is definitely on the wish list. We’'re trying to get presence/roster squared away first but would welcome any contributions if someone has already created a solution.
Why don’‘t you attach the files to an email and send them to me? It’‘s a bummer that we didn’'t coordinate better on development of this feature, though. I also worked on registration this weekend and am mostly done with the feature. Perhaps I can try to combine our work together.
I have proposition: you can publish your plans for
further Smack development
In general, I always try to keep the issue tracker up-to-date. However, I’‘ll also start using the “in-progress” feature more so that people can tell what I’'m currently working on.
The only things on the road-map are those items that are in the issue-tracker. So, if you have ideas for new features or improvements, I’‘d love to hear them, and then I’‘ll add them to the issue tracker. I’‘d also be happy to set you up with a account in the issue tracker if you’'re going to be working on issues.
Some things that are needed off the top of my head:
Unit testing framework and tests (using JUnit).
Example code snippets and applications.
MUC support (the new protocol that improves upon GroupChat).
now i have no ideas - im porting my components to beta 3
but i think that in near future i will be able to found what additional features is needed for production use (after launching first stage of our communication system) and provide example code snippets from it (now i have right to do this)