Hello all,
I’'ve recently been getting really into the wildfire server and spark client. At work I am being asked to create a simple client for our site.
I have just started working with smack, but I am hitting a bit of a wall already… I have read the “Getting Started With Smack” and I am following it closely… now for some reason, it doesn’'t look like the connect method exists in the XMPPConnection object…
try
{
XMPPConnection connection = new XMPPConnection(server);
connection.connect();
}
catch(Exception e)
{
System.err.println(e.getMessage());
}
That is my code… and connect() is underlined as if it is an error with “the method connect is undefined for the type XMPPConnection” as the description.
Now I know this has got to be something simple (yes I have imported the XMPPConnection object) but I can’'t figure it out, and being so new to this stuff, I could really use a hand… anything you can give me would be a great help!
Thanks a lot!
–d
Okay I got it… looks like connect() was deprecated… Don’'t wanna sound rude, but someone might want to look at the Getting Started section?
Message was edited by: dewey
Got it, but the “getting started” document isn’'t good anymore…
Hi dewey,
The connection() method was added in Smack 3.0.
Check the last version at the SVN http://svn.jivesoftware.org/svn/repos/smack/trunk/source/org/jivesoftware/smack/ XMPPConnection.java
What Smack version are you using?
Regards,
Francisco
Hi,
I am using 2.2.1… That was the one on the download page so I figured it was the most stable release… what’'s my best option?
Sorry for all the confusion, I am brand new to this stuff and well… it’'s confusing me :S
You may be seeing the documentation of 3.x. In previous versions the XMPPConnection.connect() did not exist, the connection was established when you create the connection new XMPPConnection(server);
There are lots of nice changes in 3.x. I recommend you Smack 3.x.
Regards,
Francisco