smack

Can I get online users in my friend list via Smack?

混江龙づ霸主 提交于 2019-11-28 20:52:35
Can i get online users in my friend list via Smack API? Is it possible? I am working on app which have chat between users. I had successfully created chat application example just entering name of friend and send chat, but now I want online friends list. Jignesh Dhua Roster roster = xmppConnection.getRoster(); Collection<RosterEntry> entries = roster.getEntries(); Presence presence; for(RosterEntry entry : entries) { presence = roster.getPresence(entry.getUser()); System.out.println(entry.getUser()); System.out.println(presence.getType().name()); System.out.println(presence.getStatus()); }

How to receive Incoming XMPP Messages using Smack?

◇◆丶佛笑我妖孽 提交于 2019-11-28 17:54:13
I read some examples and tested them but all of them need to start a chat with someone first to receive Incoming Messages... I want to retrieve this Incoming Messages without need to talk first to the jid anyone can give an example ? You need to register a ChatListener to be notified of new chats, then you can add a message listener to them like normal: connection.getChatManager().addChatListener(new ChatManagerListenerImpl()); .... private class ChatManagerListenerImpl implements ChatManagerListener { /** {@inheritDoc} */ @Override public void chatCreated(final Chat chat, final boolean

Smack 4.3.4 API

余生颓废 提交于 2019-11-28 16:28:56
Smack 4.3.4 API 包 包 描述 org.igniterealtime.smack.smackrepl Smack的REPL(读取评估打印循环)。 org.jivesoftware.smack Smack API的核心类。 org.jivesoftware.smack.android Android特有的Smack代码。 org.jivesoftware.smack.bosh Smack的BOSH API(XEP-206,XEP-124)。 org.jivesoftware.smack.chat Smaks传统API用于1:1聊天。 org.jivesoftware.smack.chat2 Smack针对1:1聊天的新改进API。 org.jivesoftware.smack.compress.packet Stanzas和XMPP流压缩的扩展元素(XEP-138)。 org.jivesoftware.smack.compression Smack类压缩。 org.jivesoftware.smack.compression.jzlib 通过JZlib支持XMPP流压缩(XEP-138)。 org.jivesoftware.smack.debugger 核心调试器功能。 org.jivesoftware.smack.experimental 课程特别适合实验。 org

How to use Smack 4.1 in Android?

送分小仙女□ 提交于 2019-11-28 15:51:55
问题 I was looking at this answer Using your own XMPP server for android chat app (Smack API) to learn about the available XMPP APIs. Smack seems like a good choice. Prior to Smack 4.1 one had to rely on aSmack. Starting with 4.1, Smack will run natively on Android. I have a couple of "getting started" questions. Question 1: How do I include Smack 4.1 in my Android project in Eclipse? The instructions here https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide seem to be

File Transfer not working smack 4.1 android

邮差的信 提交于 2019-11-28 13:09:42
Currently I am playing around with the new Smack 4.1 that offers full support for android. Sending and receiving messages is no problem, works fine. But now, I get stuck on sending and receiving Files. For example: Send File public void sendFile(String fileName,String to){ if(transferManager==null) { transferManager = FileTransferManager.getInstanceFor(mConnection); } OutgoingFileTransfer transfer = transferManager.createOutgoingFileTransfer(to); try { transfer.sendFile(new File(fileName), "This is a Test!"); } catch (SmackException e) { e.printStackTrace(); } } Receive files public void

Smack API - Read Chat History from Openfire Server

爱⌒轻易说出口 提交于 2019-11-28 07:52:15
How can I fetch chat log or chat history from Openfire server using Smack library into an Android application? As far as I know, there is no storing of chat history in Openfire. You can only get offline messages sent by user (when they connect next time for example), but if you want to store the messages you can implement it yourself directly on the XMPP server (personally I did it using mongodb - it works great!). But then, maybe I missed something in Openfire... Openfire server can surely save chat histories. To turn it on, you should go to Server/Server Settings/Message Audit Policy and

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 =

Search for existing user using xmpp/UserSearchManager in Android

混江龙づ霸主 提交于 2019-11-28 05:49:16
问题 I have gone through this1, this2 and this3 but still cannot find the solution of the problem. I could know where my problem is what I am doing in this code is: Take the input from textbox and Pass that value to check if the username supplied in the textbox exists or not Whenever I click check button only "Function called" is displayed and is not performing search. Here is my code what I done so far. public class Registration extends Activity implements OnClickListener { private final static

Chat App for Android using a XMPP Server and Firebase Cloud Messaging for Push Notifications

瘦欲@ 提交于 2019-11-28 05:34:49
问题 I'm trying to send custom IQ from register device to ejabberd xmpp server for FCM configuration but still i can't received FCM notification and receiving Error like "user not registered at XMPP". Step 1 : Created class for Custom IQ public class IQGetSomething extends IQ { public static final String ELEMENT = "push"; public static final String NAMESPACE = "p1:push"; String refreshedToken; String userName; public IQGetSomething(String refreshedToken,String userName) { super(ELEMENT, NAMESPACE)

Smack 4.1 Android anonymous registration to Openfire

 ̄綄美尐妖づ 提交于 2019-11-28 01:53:08
问题 I want connect anonymously to openfire server with Android Smack 4.1 client and register the new user (username = "wq", password="wq") with AccountManager, and then disconnect and login as non-anonymous registered user. 3.1.1 Registration with a Server Special care must be taken when an unregistered entity interacts with a server rather than a service. Normally, a server enables in-band registration so that entities can "bootstrap" their participation in the Jabber network; this bootstrapping