asmack

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

江枫思渺然 提交于 2019-11-27 01:21:42
问题 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. 回答1: Just use like this : Presence availability = roster.getPresence(user); Mode userMode = availability.getMode(); retrieveState_mode(availability.getMode(),availability

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

孤者浪人 提交于 2019-11-26 18:36:45
问题 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

getSearchForm returns null when using UserSearch in XMPP with aSmack

怎甘沉沦 提交于 2019-11-26 14:20:09
问题 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

Unable to receive file using asmack and xmpp

假如想象 提交于 2019-11-26 14:10:03
问题 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

How to know Typing Status in XMPP openfire using Smack

半腔热情 提交于 2019-11-26 10:32:17
问题 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 \"

Android and XMPP: Currently available solutions [closed]

左心房为你撑大大i 提交于 2019-11-26 01:22:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 months ago . Which XMPP library would be the best choice nowadays for Android development? I\'ve been using the patched Smack library as is suggested in many other questions here in SO. However, that\'s a patched version of the Smack API from two years ago. And although it generally works well I\'m exploring any other, more