vcard 修改頭像

import org.jivesoftware.smack.util.StringUtils;//引入包

XMPPConnection con;

byte[] bytes;

 con = XmppUtils.getInstance().getConnection();

 VCard vCard = new VCard();
   vCard.load(con, ConfigEntity.uname + "@192.168.1.66");

bytes = LiaoYiLiaoMyInfo.readByte(ConfigEntity.userHeadImg);

  String encodedImage = StringUtils.encodeBase64(bytes);
    v.setAvatar(bytes, encodedImage);
    v.setEncodedImage(encodedImage);
    v.setField("PHOTO", "<TYPE>image/jpg</TYPE><BINVAL>" +
    encodedImage
    + "</BINVAL>", true);
   
    v.save(con);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章