How to send one to one message using smack API 4.1.0 android
<p>I am using the code from the official documentation of smack API to send message to a specific Jabber ID.<br>
<a href="http://download.igniterealtime.org/smack/docs/latest/documentation/index.html" rel="nofollow">CLick Here</a></p>

<p>I am able to receive messages from a room using below code.  </p>

<pre><code>   public  void joinChatRoom(){
        MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
        multiUserChat = manager.getMultiUserChat("test@-mbp-9");
        try {
            multiUserChat.join("user");
        } catch (SmackException.NoResponseException e) {
            e.printStackTrace();
        } catch (XMPPException.XMPPErrorException e) {
            e.printStackTrace();
        } catch (SmackException.NotConnectedException e) {
            e.printStackTrace();
        }
        ChatManager.getInstanceFor(connection).addChatListener(new ChatManagerListener() {
            @Override
            public void chatCreated(Chat chat, boolean createdLocally) {
    chat.addMessageListener(new ChatMessageListener() {
        @Override
        public void processMessage(Chat chat, Message message) {
            System.out.println(message.getBody());
        }
    });
            }
        });
        System.out.println("Test");
    }
</code></pre>

<p>My <strong>Question</strong> is that how can I send message to a specific JID because i am not able to work it out even after a lot of googling what i am missing. Connection is fine user is also authenticating but below code is now working for send message.  </p>

<pre><code> public void sendMsg() {
        if (connection.isConnected()) {
            // Assume we've created an XMPPConnection name "connection"._
            chatmanager = ChatManager.getInstanceFor(connection);
            newChat = chatmanager.createChat("user123@csofts-mbp-9", new ChatMessageListener() {
                @Override
                public void processMessage(Chat chat, Message message) {
                    System.out.println("Received Message:"+message);
                }
            });

            try {
                System.out.println("check the message....");
                newChat.sendMessage("Howdy!alksd;lsakdsa;lkdsa;lksa;lsa");
            } catch (SmackException.NotConnectedException e) {
                e.printStackTrace();
            }
        }
    }
</code></pre>

<p>Any Help will be appreciated Thanks.</p>