如何使用Asmack Android从Openfire检索一对一聊天记录 [英] How to retrieve one to one chat history from Openfire using asmack android
问题描述
请问有人可以使用asmack库和XMPP协议向我展示从openfire服务器到android客户端应用程序检索聊天记录的确切代码吗?在我的openfire服务器中,启用了合并的监视服务/打开存档服务,并且所有消息已成功存储到数据库中.但是我不知道这些消息(聊天记录)如何检索到以ANDROID构建的客户端应用程序.我需要哪种类型的聊天是一对一的用户聊天(而不是群组聊天).
Please can anyone show me the exact code for retrieving a chat history from openfire server to android client application using asmack library and XMPP protocol? In my openfire server I was enable merged Monitoring service/Open archive service and all messages successfully stored into database. But I don't know how those messages (chat history) retrieve to my client application which is building in ANDROID. What type of chat I need is one-to-one user chat (not group chat).
I am success ed to getting group chat history with help of this but i want to retrieve one to one chat history
如果有人可以给我写代码,请多谢.
Please if anyone can write me a code, I'd be very grateful.
谢谢!
推荐答案
public class XMPPManager implements PacketListener {
........
void connect(){
//Init connection configuration
......
XMPPTCPConnection xmppTCPConnection = new XMPPTCPConnection(connectionBuilder.build());
xmppTCPConnection .connect();
xmppTCPConnection.addSyncStanzaListener(this, null);
}
@Override
public void processStanza(Stanza packet) {
//Log.d("Log","Body - " + message.getBody());
}
}
这篇关于如何使用Asmack Android从Openfire检索一对一聊天记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!