How can i get nickName of a user

hi to all

im using smack api amd wild fire server

im unanle to get the nick name of the roster entries…

any body plz help me , how to get the nick names of roster entries…

thanks in advance…

Hi Vishnu,

You can get the User’'s nick name using the VCard in Smack.

Below is the sample code


import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smackx.packet.VCard; public class NickName {
    public static void main(String[] args) throws Exception{
                XMPPConnection con = new XMPPConnection("localhost");
        con.login("user1","user1");
        VCard vc = new VCard();
        vc.load(con,"user2@example.com");
        System.err.println(vc.getNickName());
    }
}

Regards,

Jitendra