Class VCard

  • All Implemented Interfaces:
    Element, FullyQualifiedElement, IqView, NamedElement, StanzaView, TopLevelStreamElement, XmlLangElement

    public final class VCard
    extends IQ
    A VCard class for use with the SMACK jabber library.

    You should refer to the XEP-54 documentation.

    Please note that this class is incomplete but it does provide the most commonly found information in vCards. Also remember that VCard transfer is not a standard, and the protocol may change or be replaced.

    Usage:

    
     // To save VCard:
    
     VCard vCard = new VCard();
     vCard.setFirstName("kir");
     vCard.setLastName("max");
     vCard.setEmailHome("foo@fee.bar");
     vCard.setJabberId("jabber@id.org");
     vCard.setOrganization("Jetbrains, s.r.o");
     vCard.setNickName("KIR");
    
     vCard.setField("TITLE", "Mr");
     vCard.setAddressFieldHome("STREET", "Some street");
     vCard.setAddressFieldWork("CTRY", "US");
     vCard.setPhoneWork("FAX", "3443233");
    
     vCard.save(connection);
    
     // To load VCard:
    
     VCard vCard = new VCard();
     vCard.load(conn); // load own VCard
     vCard.load(conn, "joe@foo.bar"); // load someone's VCard