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 .

1476 questions
4
votes
2 answers

aSmack error: XMPPConnection is abstract; cannot be instantiated

I'm following a tutorial to make a very basic chat app with Android Studio, but I'm getting the error: Error:(131, 45) error: XMPPConnection is abstract; cannot be instantiated at the following line: ConnectionConfiguration connConfig = new…
zeroone
  • 43
  • 1
  • 6
4
votes
1 answer

how to differentiate received messages between users using smack and java?

I am using servlets to send & receive chat messages to facebook using smack . In that user's "A" & "B" are chating with user "C". If user "C" send's message only to "A" ,that message also received by "B". How to differenciate the messages…
user2709752
  • 488
  • 6
  • 26
4
votes
3 answers

How Can I create,send and receive iq packets using smack(java)

I am connected to server(Xmpp) but unable to send and receive packets at my psi client Here is snippet of my code POSClientIQ posclientiq = new POSClientIQ(); posclientiq.connectXMPPServer(); posclientiq.processMessage(); } public…
Hardik
  • 41
  • 1
  • 3
4
votes
1 answer

How to set custom Message.Type string in Smack?

I am trying to send a chat using Smack. Here is the code Chat chat = connection.getChatManager().createChat("2@coolcast.com", this); Message _msg = new Message(); _msg.setBody("Hello this is a test message"); chat.sendMessage(_msg); This…
S B
  • 8,134
  • 10
  • 54
  • 108
4
votes
3 answers

Sending and receiving message using Java Smack API not working on example

I am still trying to learn how to properly work with the java Smack API, so I followed a mini-tutorial in a java programming forum here: How to Write a simple XMPP (Jabber) client using the Smack API I then changed the code to my needs. The code…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
4
votes
1 answer

Search for users on Ejabberd2 using smack, fails

Server: ejabberd2 XMPP: smack 3.3.1 The goal is to design a chat engine. The user, by entering a username should be able to find out if the entered username is registered on the server. The Smack Javadocs can be found here I am using UserSearch…
4
votes
4 answers

ReconnectionManager in asmack

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…
duong_dajgja
  • 4,196
  • 1
  • 38
  • 65
4
votes
1 answer

Google Cloud Connection Server and smack

I'm trying to get a java server set up for communicating to Google's Cloud Connection Server using the smack library. I have set up an app ID and API key through Google APIs and am trying to use the following code: import…
gunglefunk
  • 423
  • 3
  • 7
4
votes
1 answer

Can not receive chat messages in Android using XMPP and aSmack

I am writing a chat client in Android using the XMPP protocol. I have used the asmack.jar as provided by http://asmack.freakempire.de/. The implementation works in plain Java (using smack.jar) which I have tested. But in Android, I can only send…
nkr
  • 118
  • 1
  • 8
4
votes
3 answers

How to find out the room occupants when someone joined or left a MultiUserChat in smackx?

I am trying to implement a MultiUserChat with the smackx api. So far I managed to create a new MultiUserChat room, join it, and send invites out. My problem as of now is how to find out who is in the chat room if someone joined the chat room or left…
Haf
  • 65
  • 1
  • 5
4
votes
0 answers

Can I add extra property to a MultiUserChat RoomInfo?

In Smack, we can get the information of a room by RoomInfo. And now I have an extra info(like the location where a room belongs) for a room, how can I do this by smack? for example, in current smack: a admin can set room info(like description of a…
Ray
  • 41
  • 1
4
votes
3 answers

SMACK: how do I listen for user availability status changes?

How do I subscribe to listen to user availability status changes in SMACK? To get the availability status for a user I use the following: XMPPConnection.getRoster().getPresence(name).isAvailable(); But how can I subscribe so I receive some…
Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
4
votes
2 answers

Patterns for building chat application with XMPP

I built an Android application with Google App Engine Server. Now I want to add simple chat to my app. And I have some questions. My users registered with theirs desired email domains like hotmail.com, yahoo.com and even more esoteric domains,…
John Lock
  • 41
  • 2
4
votes
2 answers

Architecture for a chat website using Openfire, Smack and Play! Framework

I am developing a chat website that makes use of the Openfire XMPP server, with the client side using Smack API. The web project that makes use of the Smack API is implemented using the Play! framework making it RESTful. I chose Play! because of its…
c05mic
  • 558
  • 5
  • 18
4
votes
2 answers

Can't send or receive presence with ASmack

I am trying to develop a XMPP chat client for Android (using Java connected to C#/Unity). I have got the Java -> Unity/C# connection working perfectly. I have also downloaded Asmack and can generate a library and my of wrapper class for initilazing…
Sunkas
  • 9,542
  • 6
  • 62
  • 102