Send message using Smack 4.1.0 in Android

Hi, I’m using Smack 4.1.0 in Android and Openfire 3.10.0 as server. I created a user called admin in the server, and I’m trying to send a message to him, but I don’t know exactly how to do, I’ve tryed many sugestions but none seems to work. I can connect and login to the server with no problems, but the messages aren’t send, I’m logged with the user admin in Spark, and I see the user logged in my application as online, but the messages sent don’t show. I’m doing all that with my pc as server. Here how I’m trying:

XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder();

config.setUsernameAndPassword(sUser, sSenha);




AbstractXMPPConnection con = new XMPPTCPConnection(;


\here connects normal


\login works fine too


\that’s how I’m trying to send the message

String to = “admin”;

String from = con.getUser();

ChatManager chatManager = ChatManager.getInstanceFor(con);

Message message = new Message(to,;



message.addExtension(new DefaultExtensionElement(“from”,from));

message.addExtension(new DefaultExtensionElement(“to”, to));


} catch (IOException e){

con = null;

return false;

} catch (SmackException e){

con = null;

return false;

} catch (XMPPException e){

con = null;

return false;

}finally {

return true;


If someone could help I would appreciate.

You must specify a bare or full Jid as ‘to’.

What should be the full Jid? By example, I can log just with “admin”, to send to “admin” a message, what should I put together to form a Full Jid?

Thanks by your answer! Now I managed to send the message, I used my connection con.getUser();, then this showed exactly how I supposed to fill the user with the Full Jid.
Thanks a lot! This really helped me.