asmack

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

java.net.UnknownHostException while connecting openfire xmpp server

穿精又带淫゛_ 提交于 2019-11-29 18:44:41
I am a beginner for chat app. I started studing regarding chat app I am trying to connect android virtual device to openfire xmpp server, but am unable to connect, I am getting java.net.UnknownHostException can anyone help me in connecting my android device top xmpp server The code I am using is: ConnectionConfiguration config = new ConnectionConfiguration("pc" ,5222); /*ConnectionConfiguration config = new ConnectionConfiguration("192.168.0.1",5222,"pc");*/ /*config.setCompressionEnabled(true); config.setSASLAuthenticationEnabled(true); */ config.setSecurityMode(SecurityMode.disabled); config

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

android asmack 注册 登陆 聊天 多人聊天室 文件传输

末鹿安然 提交于 2019-11-29 02:24:31
XMPP协议简介 XMPP协议(Extensible Messaging and PresenceProtocol,可扩展消息处理现场协议)是一种基于XML的协议,目的是为了解决及时通信标准而提出来的,最早是在Jabber上实现的。它继承了在XML环境中灵活的发展性。因此,基于XMPP的应用具有超强的可扩展性。并且XML很易穿过防火墙,所以用XMPP构建的应用不易受到防火墙的阻碍。利用XMPP作为通用的传输机制,不同组织内的不同应用都可以进行有效的通信。 这篇文章有基本的介绍, http://blog.csdn.net/xutaozero21/article/details/4873439 IM Instant Messenger,及时通信软件,就是大家使用的QQ、MSN Messenger和Gtalk等等。其中Gtalk 就是基于XMPP 协议的一个实现,其他的则不是。当前IM 几乎作为每个上网者必然使用的工具,在国外的大型企业中有一些企业级的IM应用,但是其商业价值还没完全发挥出来。设想既然XMPP 协议是一个公开的协议,那么每个企业都可以利用它来开发适合本身企业工作,提高自身生产效率的IM;甚至,你还可以在网络游戏中集成这种通信软件,不但让你可以边游戏边聊天,也可以开发出适合游戏本身的IM 应用,比如说一些游戏关键场景提醒功能,团队语音交流等等都可以基于IM来实现。

java.net.UnknownHostException while connecting openfire xmpp server

倖福魔咒の 提交于 2019-11-28 13:47:20
问题 I am a beginner for chat app. I started studing regarding chat app I am trying to connect android virtual device to openfire xmpp server, but am unable to connect, I am getting java.net.UnknownHostException can anyone help me in connecting my android device top xmpp server The code I am using is: ConnectionConfiguration config = new ConnectionConfiguration("pc" ,5222); /*ConnectionConfiguration config = new ConnectionConfiguration("192.168.0.1",5222,"pc");*/ /*config.setCompressionEnabled

XMPP aSmack - How can I get the current user state (offline/online/away/etc.)?

若如初见. 提交于 2019-11-28 06:26:40
I am new to xmpp/asmack in android. Can anyone please help me in getting the presence of the user's friends ( roster list) I am using this : Presence availability = roster.getPresence(user); Mode userMode = availability.getMode(); What else should I do to get the availability status of each user listed in my roster. Gaurav Arora Just use like this : Presence availability = roster.getPresence(user); Mode userMode = availability.getMode(); retrieveState_mode(availability.getMode(),availability.isAvailable()); public static int retrieveState_mode(Mode userMode, boolean isOnline) { int userState =

ConnectionException when trying to connect to XMPP server from aSmack Android client

a 夏天 提交于 2019-11-27 16:23:22
I have been trying to connect to my (locally hosted) Openfire XMPP server from my aSmack Android client for hours now, and it's still not working. I get a org.jivesoftware.smack.SmackException$ConnectionException and that's it. Code: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); SmackAndroid.init(getApplicationContext()); connect(); } private boolean connect(){ XMPPConnection connection = new XMPPTCPConnection(HOST); try{ connection.connect(); connection

getSearchForm returns null when using UserSearch in XMPP with aSmack

こ雲淡風輕ζ 提交于 2019-11-27 08:47:00
I have this code, almost unmodified from examples: UserSearchManager usm = new UserSearchManager(conn); Form searchForm = usm.getSearchForm("search.myserver.com"); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", contact.getJid()); ReportedData data = usm.getSearchResults(answerForm, "search.myserver.com"); This works perfectly in a Desktop environment, using Smack library, but I can't get it to work in Android (where I have to use asmack). The problem is searchForm is null because getSearchForm returns null. This seems to

Unable to receive file using asmack and xmpp

人盡茶涼 提交于 2019-11-27 08:32:31
I'm working on file sharing using asmack and xmpp. I am able to send file but not able to receive file on another device. I did so much of Research and Development, found so many ways tried all of them but haven't got success. Seems I am making any small mistake, tried alot but haven't got solution for my problem. The code I used for sending file is: d.findViewById(R.id.btnsendphoto).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if (!filepath.equals("")) { configureProviderManager(connection); FileTransferNegotiator.IBB

How to know Typing Status in XMPP openfire using Smack

☆樱花仙子☆ 提交于 2019-11-27 03:26:15
I am developing chat application by using Openfire XMPP server. I can text chat between two user. But i want to know Typing status when some one is typing message. So i created a class :- public class typingStatus implements ChatStateListener { @Override public void processMessage(Chat arg0, Message arg1) { // TODO Auto-generated method stub } @Override public void stateChanged(Chat arg0, ChatState arg1) { // TODO Auto-generated method stub System.out.println(arg0.getParticipant() + " is " + arg1.name()); } } But i am confuse so that How will it work? I know that i need a packet where i can it