Questions tagged [smack]

Smack is an XMPP (Jabber) client library written in Java for Android and Java SE. It provides a simple API allowing developers to write clients for XMPP services.

Smack is an Open Source Java library for writing XMPP based clients. It provides access to the core functionality as well as many of the XMPP extensions. Smack supports both standard Java and Android since version 4.1 and obsoletes the fork.

Note: For Linux SMACK (Simplified Mandatory Access Control Kernel) see .

1461 questions
166
votes
7 answers

Android and XMPP: Currently available solutions

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.…
alkar
  • 5,288
  • 7
  • 25
  • 43
59
votes
3 answers

Why am I getting java.lang.IllegalStateException "Not on FX application thread" on JavaFX?

I have an application that has a TableView that has an attached listener so it refreshes as soon as it detects a change, but the thing is that I´m getting java.lang.IllegalStateException: Not on FX application thread; currentThread = Smack Listener…
linker85
  • 1,417
  • 3
  • 24
  • 39
27
votes
6 answers

How to keep a XMPP connection stable on Android with (a)smack?

I use asmack-android-7-beem library for Android. I have a background service running, such as my app stays alive. But sooner or later XMPP connection dies without any notice. The server says that the client is still online but no packets are sent or…
Max
  • 271
  • 1
  • 3
  • 3
26
votes
3 answers

No response from remote client: error during file transfer using asmack

I have a problem while receiving file using asmack. Here I paste error and packets that I sent and receive log // error 04-21 19:21:05.109: WARN/System.err(7401): Error in execution: 04-21 19:21:05.109: WARN/System.err(7401): -- caused by:…
Kutbi
  • 1,008
  • 2
  • 16
  • 30
25
votes
1 answer

How to use Smack 4.1 in Android?

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…
An SO User
  • 23,378
  • 30
  • 119
  • 197
24
votes
4 answers

How to receive Incoming XMPP Messages using Smack?

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 ?
Winter
  • 1,816
  • 4
  • 30
  • 41
24
votes
6 answers

XMPP client using Smack 4.1 giving NullPointerException during login

I am trying to use Smack 4.1.0-rc3 for implementing a java xmpp client which connects to a ejabberd xmpp server. I am using the following code for connecting to the server. XMPPTCPConnectionConfiguration connConfig = …
Deepu
  • 291
  • 2
  • 3
20
votes
3 answers

Integrating Smack with Android Studio project for chat application

I am trying to implement a chat messenger using ejabberd server and smack library but having a hard time to integrate all the jars and dependencies of smack. I am using android Studio. My build.gradle(module): apply plugin:…
no one
  • 467
  • 5
  • 18
18
votes
5 answers

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

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…
samsad
  • 1,326
  • 1
  • 10
  • 15
17
votes
5 answers

how to add roster with subscription mode "both"

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 =…
snowway
  • 181
  • 1
  • 1
  • 7
17
votes
2 answers

Smack 4.1 Re-connection issue

I am developing a Chat application in which I have a background service that is continuously running. The Application is running smoothly and I am able to receive and send messages without any issue. I am using default Smack 4.1 Re-connection…
shanraisshan
  • 3,073
  • 1
  • 15
  • 39
16
votes
2 answers

GCM XMPP Server using Smack 4.1.0

I'm trying to adapt the example provided here for Smack 4.1.0. and getting a little confused. Specifically I'm struggling to understand what the GcmPacketExtension should now extend, how the constructor should work and how the…
B.A.
  • 581
  • 5
  • 10
16
votes
6 answers

How to get timestamp of incoming xmpp message?

I am using aSmack library to communicate with remote xmpp server. I am able to send/receive messages, but I want to get timestamp of incoming message. Could you tell me please, is it possible at all? Because I can't find anything about this…
Infernus
  • 287
  • 1
  • 4
  • 10
15
votes
5 answers

XMPP messages lost on Android while switching data connectivity (e.g. turning Wifi of, GSM <-> Wifi switch)

I'm developing a chat application in android. Using XMPP server. PHP server has been migrated to ejabber. My notification works properly in all scenarios. But in one case I am losing the XMPP messages. In fact I am not getting notifications. In…
Alpan
  • 518
  • 1
  • 6
  • 20
14
votes
9 answers

How to register a new user on XMPP using (a)Smack library

I have set up a xmpp server and android client using the great post here... I have some pre defined users set up in the xmpp server and i could login with those credentials. Now, from my app i want to register as new users to the xmpp server through…
Rahul Kalidindi
  • 4,412
  • 13
  • 53
  • 90
1
2 3
97 98