powered by Jive Software

How to connect to gateways with the Smack API?

I read a lot of old posts on this before posting many of which were quite old.

Some posts it couldnt be currently be done with the Smack API but were over a year old so i was wondering if this can now be done in more recent builds?

A lot of the posts werent detailed enough and just referred to JEP 100 which explains how to connect to transports with raw xml whcih kind of defeats the point of using Smack really.

If this still cant be done currently with Smack can someone explain how i can send raw xml over an established Smack XMPPConnection?



There are three steps you will want to go through in order to connect to a gateway:

Step one, discover the gateway, this can be done using service discovery which is supported by Smack and is detailed in this thread:


Step two and three are interchangable depending upon how you would like to handle things in your client. Basicly, you need to register with the gateway and you will need to add it to your roster. To register with the gateway you can use Registration packets:

http://www.jivesoftware.org/builds/smack/docs/latest/javadoc/org/jivesoftware/sm ack/packet/Registration.html

And to add the gateway to your roster you’'ll want to use: Roster#createEntry()

If you need anymore help feel free to ask.


I am trying to connect to netmindz.net Jabber server.

If i run service discovery on netmindz.net it fails, if i do the same thing on aim.netmindz.net or yahoo.netmindz.net it doesn’'t fail.

But arent i doing the service discovery to find out this information in the first place?

When you say it fails, what do you mean?