smack

通过XMPP协议实现即时通讯介绍

为君一笑 提交于 2019-11-30 08:23:30
四种即时通讯协议 概述 目前IM有四种协议:即时信息和空间协议( IMPP )、空间和即时信息协议( PRIM )、针对即时通讯和空间平衡扩充的进程开始协议 SIP (SIMPLE)以及 XMPP 。PRIM与XMPP、 SIMPLE类似,但已经不再使用了。 在这四种协议中,XMPP是最灵活的。XMPP是一种基于XML的协议,它继承了在XML环境中灵活的发展性。因此,基于 XMPP的应用具有超强的可扩展性 。经过扩展以后的XMPP可以通过发送扩展的信息来处理用户的需求,以及在XMPP的顶端建立如内容发布系统和基于地址的服务等应用程序。而且,XMPP包含了针对服务器端的软件协议,使之能与另一个进行通话,这 使得开发者更容易建立客户应用程序或给一个配好系统添加功能 。 采用XMPP协议的即时通信应用,当数google吧,Google Talk是基于XMPP协议,而且 它还允许其它IM自由使用XMPP协议 。如此一来, 任何IM供应商在遵循XMPP协议的前提下,都可以随时与Google Talk实现免费连接 . XMPP协议 什么是IMPP ? XMPP的前身是Jabber, 一个开源形式组织产生的网络即时通信协议 。XMPP目前被IETF国际标准组织完成了标准化工作。标准化的核心结果分为两部分:核心的XML流传输协议、基于XML流传输的即时通讯扩展应用 XMPP的核心XML流 传输协议

How to get Openfire chat history on Android device with aSmack?

泪湿孤枕 提交于 2019-11-30 08:17:30
问题 I am developing a chatting application, where user will chats with one of the domain expert's group member. user uses my android app and domain expert uses spark web for chatting. I made Openfire setup and Spark web setup and developed Android chatting app with aSmack library. My app users are able to chat with domain expert. So far it is fine. Now I would like show chat history of user with any or specific expert on Android device. After surfing web, I am able to install Monitoring Service

“CertPathValidatorException: Trust anchor for certification path not found.” with (a)Smack 4.0.0

五迷三道 提交于 2019-11-30 07:16:39
问题 I have recently updated the asmack jar. Now I am getting an error like this: 07-18 12:49:29.523: W/XMPPConnection(6817): javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. When I am trying to connect. Earlier everything was working properly (with old version). 回答1: Yes,with the older version of asmack(till aSmack-0.8.10) below code was working fine without any error if you write something like below,

Smack throws “NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils”

守給你的承諾、 提交于 2019-11-30 05:27:28
问题 I got a problem with my app in which I want to create a simple XMPP client that connects to my server. I got the following problem when I'm starting the app (compilation runs through without problems), but my app closes instantly. java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils; at org.jivesoftware.smack.provider.ProviderManager.getKey(ProviderManager.java:314) at org.jivesoftware.smack.provider.ProviderManager.addStreamFeatureProvider(ProviderManager

How to get custom attribute value from an XMPP XML message?

别等时光非礼了梦想. 提交于 2019-11-30 04:08:50
问题 Ok guys, simple question but pretty important to me. so, other android client are sending this xml msg: <message id='6ymdM-19' to='xox@xox.xox/smack' type='chat'> <subject>normal</subject> <received xmlns='urn:xmpp:receipts' id='HVgQw-5'/> </message> and my listener is roughly like this: private class MsgListener implements ChatStateListener { /** * Constructor. */ public MsgListener() { } @Override public void processMessage(Chat chat, org.jivesoftware.smack.packet.Message message) { String

ReconnectionManager in asmack

不羁的心 提交于 2019-11-29 22:19:44
问题 I have a project on Android, which needs to use asmack library to enable real time chat. The key feature is reconnecting mechanism, that means my application can reconnect automatically whenever the internet connection loses. Here is my code snippet: ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT); connConfig.setSASLAuthenticationEnabled(true); connConfig.setReconnectionAllowed(true); XMPPConnection connection = new XMPPConnection(connConfig); But I got this error

how to add roster with subscription mode “both”

我的梦境 提交于 2019-11-29 21:52:24
i'm using smack 3.1.0, and when i add a roster,i can't get subscription "both". who can help me? below is my code: Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.accept_all); Roster roster = connection.getRoster(); roster.createEntry("buddy@test.com","me",null) after the code execution, i observed in openfire the subscription is "to" Joe Hildebrand Rewriting @mschonaker's answer to be a little more clear. Both users need to subscribe to each other and accept the subscription request they received. Let's call them Alice and Bob. Alice sends a subscription request to Bob: Presence

Java - trying to prebind converse.js using bosh but not able to get the sid and rid…using the smack bosh

微笑、不失礼 提交于 2019-11-29 15:49:17
I am trying to connect to the open fire using the smack bosh and trying to prebind the converse.js in the web page. My bosh code BOSHConfiguration config = new BOSHConfiguration(false, "host", 7070, "/http-bind/", "<host>", "xmpp:127.0.0.1:5222"); BOSHConnection connection = new BOSHConnection(config); try { connection.connect(); connection.login("un", "pw"); String sss = connection.getConnectionID(); String bosh = connection.BOSH_URI; } catch (Exception e) { } Can some one help me how to establish a bosh connection and get the required sid, rid and jid from the session.... Any help is much

Not able to receive group message using smack

可紊 提交于 2019-11-29 15:36:12
var multiUserManager: MultiUserChatManager = MultiUserChatManager.getInstanceFor(constants.obj.connection) var multiUserChat: MultiUserChat =multiUserManager.getMultiUserChat(JidCreate.entityBareFrom(roomName)) var a: Resourcepart = Resourcepart.from(PreferenceManager.getDefaultSharedPreferences(applicationContext).getString("j_id", null)) multiUserChat.join(a) multiUserChat.addMessageListener { object: MessageListener { override fun processMessage(message: Message?) { Log.v("Message is ",message.toString()) Log.v("Message from ",message!!.from.toString()) Log.v("Message is ",message.getBody()

Cannot get list of public rooms from xmpp Server on Android?

假如想象 提交于 2019-11-29 15:20:54
问题 Hello Everyone i am new to android and i am currently stuck on this. I have to return list of public rooms created on xmpp server. The problem i am having is that the code below works fine for java but there is a null pointer exception in case of android. Any help regarding this would be appreciated. I am using an openfire server and testing it on local machine so that is the reason why i am using ip Address instead of domain name. I am using smack library for JAVA and Asmack Library for