HI Guys
Please help me. I am developing android xmpp Client using Smack 4.1.3 + Openfire 3.10.2 server. I am able to receive the messages sent from SPARK windows client but not able send the message to the same. Kindly help me… here is my code :
public void sendMessage(String buddyJID, String messageTe) {
String OurBuddy = buddyJID + “@” + ChatContants.SERVICENAME;
String from = connection.getUser();
Log.d(TAG,
String.format(
“Connection is null in sendMessage Sending mesage ‘%1$s’ to user %2$s from Me %3$s”,
messageTe, OurBuddy, from));
if (chatManager != null) {
Message msgObj = new Message();
msgObj.setBody(messageTe);
msgObj.setTo(OurBuddy);
msgObj.setFrom(from);
msgObj.setType(Message.Type.chat);
msgObj.addExtension(new DefaultExtensionElement(“from”, from));
msgObj.addExtension(new DefaultExtensionElement(“to”, OurBuddy));
try {
connection.sendStanza(msgObj);
///LOgs sent message
} catch (NotConnectedException e) {
// TODO Auto-generated catch block
Log.d(TAG, “sendStanza is creating some problem”);
e.printStackTrace();
}
} else {
Log.d(TAG, “XMPPMANGER sendMEssage chamAnaeger is Null”);
}
}
ChatContants.SERVICENAME is same as provided in openfire domain name,
Already connected and logged in.
I am getting the sent message logs but not receiving any thing in SPARK client.