I want to send a message to a roster Group (like friends group) by using asmack.(i dont want to create a room using multi user chat)
Asmach has this :
Message msg=new Message(java.lang.String to, Message.Type type)
when want to a single user i use : Message("a@b.com",Message.Type.chat)
but in group chat I think I have to use Message(java.lang.String to, Message.Type.groupchat) but I don't know what java.lang.String to should be?
XMPP does not specifiy a mechanism to send a message to a roster group. But you can easily implement that on your own. Just collect all the JIDs, and eventually all presences, of the roster group and send the message to every one of them (preferably with Smack's MultipleRecpientManager).
I managed to send message to all the roster group members in following way. You can try it.
The method that sends message to multi-users in a group
The calling method
if you need classification ask in comment.