请帮忙,我被这个问题困住了。
基本上我得到了一个基于 AVATAR 的 VCARD,我可以在调试模式下看到它,但是 ASMACK 没有正确解析图像。它只是删除包含图像值的标签。
Logcat 显示正在接收的 XML:
DEBUG/SMACK(1336): <NICKNAME>TC</NICKNAME>
DEBUG/SMACK(1336): <PHOTO><TYPE>im
DEBUG/SMACK(1336): age/jpeg</TYPE><BINVAL>iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACHklEQVR42u2Zv64BQRSH9xmUCrUHEAUShUqlshWJxhOIECJ0oqIQL6BTK
DEBUG/SMACK(1336): 1AKrcYDkEgkKq3/9ya/5DQnTmaxbnb2zkm+Yu1a51szs2dmrJ8vxf1+BzxutxtwK6x/LyAlSvF4PACP6/UKjMBfNR2VqBF4N6QmQgnzxN0WMQIqkXevMwLvdlqe4G63A
DEBUG/SMACK(1336): 5fLBXiuE2svoGoalmWB0WgEtOvE2ghIxVoymQSFQgEUi0VgBF4VOB6PYDqdgslkAmazGaDPicViAYLBIKBotVognU6DT5us/wToBHU2Oq7X68C2bdDtdkGn03lKu90GJ
DEBUG/SMACK(1336): Mjv3+/3QTweB+fzGagGBd5E9RfgiUpfqNVqYLVaAacTlNPpBKQYDocgHA4D/gBVL1D9BaQTXKharYL5fA5IjP+ldKyaMvJye7PZgEAgAKR8uJj+AqpijIKa0HK5BE6HO
DEBUG/SMACK(1336): UmQx3g8BpFIBPDrxFJFewFVUUY3ajQagDoxF3e6TMK/V6lUQCwWA7zslvLxj4DTKV65XAaJRAJQcZbL5UA+nwd0nM1mwWAwADwhuq5UKgFJkI6lpqe/wKsLVNvtFhwOB
DEBUG/SMACK(1336): 7Df759CL7BQKAQoMpkMaDabgIT4g5R+n1/nXwG3IhqNglQqBXq9HvD8/oB2AryT0XBIk/r1eg08u6yirYCqFPnWgpYRkMpd1YvRs5t82grwxKmo+/bGhhF4VcyzGxy+E
DEBUG/SMACK(1336): aDhUhpWnU5djYBbGxtuD5e+FfgFV75bC/jUS/sAAAAASUVORK5CYII=</BINVAL></PHOTO>
DEBUG/SMACK(1336): <EMAIL><HOME/><INTERNET/><PREF/><USERID>test@test.com</
DEBUG/SMACK(1336): USERID>
在这里,在我的消息监听器中输出数据包,您可以看到照片标签被丢弃。我不知道为什么 asmack 不显示这个。
class MyPacketListener implements PacketListener{
public void processPacket(Packet packet){
System.out.println("IQ Received XML : " + packet);
Log.i("Packet IQ", packet.toString());
}
}
这是 logcat 输出:
INFO/System.out(1336): <NICKNAME>TC</NICKNAME>
INFO/System.out(1336): <TITLE></TITLE>
INFO/System.out(1336): <EMAIL><HOME/><INTERNET/><PREF/><USERID>test@test.com</USERID>