# Smack: a Java XMPP client library for Android and Java SE

> Smack is an Apache-2.0 licensed, modular XMPP client library written in Java. It is aimed at developers embedding XMPP into an Android app or a Java SE service, and its documentation points to a separate readme and upgrade guide rather than quick-start code in the repository root.

**igniterealtime/Smack** — A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs

- Repository: https://github.com/igniterealtime/Smack
- Website: https://igniterealtime.org/projects/smack/
- Stars: 2,415 · Forks: 884
- Language: Java
- License: Apache-2.0
- Published: 2026-09-28 · Updated: 2026-09-28 · Language: en
- Canonical page: https://hysenlabs.com/projects/igniterealtime-smack

## What Smack solves for Java and Android developers

XMPP is a large protocol. A working client has to negotiate TLS and SASL, bind a resource, handle stream management, route stanzas, and keep presence consistent, and none of that is application logic. Smack exists to absorb that work. The README describes it as an open-source, modular XMPP client library written in Java for Java SE compatible JVMs and Android, and says it can be embedded to build anything from a full instant messaging client to simple integrations such as sending notification messages and presence-enabling devices. The target reader is a developer who already has a Java or Android codebase and wants XMPP inside it, not a separate messaging server. The README also names machine-to-machine and IoT use cases, which fits the same shape: a small endpoint that publishes or receives stanzas without a human at the keyboard.

## The module layout is the architecture

Smack is not one jar with optional features behind flags. The top-level repository listing shows separate Gradle modules for each concern: smack-core, smack-tcp, smack-websocket, smack-websocket-okhttp, smack-websocket-java11, smack-bosh, smack-extensions, smack-experimental, smack-legacy, smack-im, smack-omemo, smack-omemo-signal, smack-openpgp, smack-sasl-javax, smack-sasl-provided, smack-resolver-dnsjava, smack-resolver-javax, smack-resolver-minidns, and two XML parser backends, smack-xmlparser-stax and smack-xmlparser-xpp3. That means you assemble the stack yourself: core plus a connection transport plus a resolver plus a parser. The trade-off is real. You get to leave out what you do not need, which matters on Android where method count is a concern, but you also have to know which module provides which piece before your first connection works. The presence of smack-java11 and smack-java11-full suggests the project also ships an aggregate for modern JVMs, and smack-android plus smack-android-extensions cover the Android side. The Makefile confirms the build is Gradle-based, with targets such as check, javadocAll, inttestFull and a jmh target scoped to smack-core.

## Adding Smack to a project and opening a connection

The README does not contain install steps. It says instructions on how to use Smack in your Java or Android project are provided in the Smack Readme and Upgrade Guide, hosted on igniterealtime.org, and it links Maven Releases and Maven Snapshots under oss.sonatype.org. So the code below reflects the documented dependency route and the standard connection shape, but you should treat the external readme as the authority on artifact coordinates and versions. A typical Gradle dependency block, following the module names visible in the repository, looks like this.

## Connecting and sending a first message

Once the modules are on the classpath, the workflow is to build a connection configuration, create an AbstractXMPPConnection, connect, log in, and send a stanza. The README gives no code sample for this, so the shape below follows the class names the module layout implies and should be checked against the Javadoc link the README provides. What you should see is a connected, authenticated session and a message delivered to the target JID.

## Licence, NOTICE obligations and paid support

Most of Smack is Apache-2.0, and the README is explicit that the licence requires the contents of a NOTICE text file to be shown within a display generated by derivative works, wherever third-party notices normally appear. It goes further than many projects do: because smack-core is Apache-2.0, the README states the conditions apply to every project using Smack, and it points to Smack.getNoticeStream() as a convenient way to retrieve the NOTICE content. Some subprojects are governed by other licences, and the README directs you to the individual subprojects rather than listing them. For an Android app this is a packaging question, not a legal footnote: you need somewhere in your about screen or bundled notices for that text. The README also mentions paid services, from XMPP and Smack consulting to designing and developing features, with a contact address for enquiries. That is worth knowing if your requirements fall outside what the API covers, since the README concedes the API may not always perfectly fit your requirements.

## Where Smack is the wrong choice

Smack is a library, so anything expecting a running service is out of scope. There is no server here, and no user interface. If you need a chat product rather than a chat client component, you would be building the product on top of Smack, not installing it. The language boundary is the harder limit: the repository is Java, the README frames it for Java SE compatible JVMs and Android, and there is no binding listed for other runtimes. A Python, Go or JavaScript service cannot consume it directly. The bug reporting path is also unusual and worth weighing before you depend on it. The README states that only a few users have access to the bug tracker, and that new users should read the how-to-ask guide, create a discourse account, log in, and post a new topic in the Smack Support sub-category. That is a forum-first support model, and the README warns that a response in the chat room may take hours. If your team needs a ticket you can file directly, plan for that friction. Finally, the modular split cuts both ways: choosing the wrong resolver or XML parser module is a configuration mistake you will debug at runtime, not a compile error.

## How Smack differs from writing XMPP yourself or using a client

The realistic alternative is not another Java XMPP library so much as the two ends of the spectrum. At one end, you implement the protocol against the XMPP specifications directly, which gives you total control over stanza handling and memory behaviour at the cost of reimplementing stream negotiation, SASL, resource binding and reconnection. Smack packages those in smack-core and smack-tcp, and adds optional layers such as smack-streammanagement, smack-omemo for end-to-end encryption, and smack-openpgp. At the other end, you deploy an existing XMPP client and skip development entirely, which is the right answer when the goal is messaging for people rather than messaging inside your software. Smack sits between them: it assumes you are writing the application and only want the protocol handled. The extension modules are where that bet pays off, because features like OMEMO or BOSH arrive as dependencies rather than as protocol work.

## Conclusion

Adopt Smack if you are building an Android or Java SE client or integration and want XMPP handled as a library rather than a service. Do not adopt it if you need a ready-made UI or a non-Java runtime, because the repository is Java only. Before committing, verify the module list in settings.gradle against your transport choice and read the separate readme and upgrade guide, since the repository README does not carry install or migration steps.

## FAQ

### What is Smack in the context of XMPP?

Smack is an open-source XMPP client library written in Java for Java SE compatible JVMs and Android. The README describes it as embeddable, so it is used inside your application rather than run as a standalone client.

### How do I install Smack in a Java or Android project?

The repository README does not contain install steps. It states that instructions are provided in the Smack Readme and Upgrade Guide on igniterealtime.org, and it links Maven Releases and Maven Snapshots under oss.sonatype.org.

### Does Smack work on Android?

Yes. The README names Android alongside Java SE compatible JVMs, and the repository contains smack-android and smack-android-extensions modules.

### What licence does Smack use?

Most of Smack is under the Apache License 2.0, and the README notes that some subprojects are governed by other licences that you should check individually. It also states that the NOTICE file contents must be shown in derivative works, retrievable via Smack.getNoticeStream().

## Sources

- [igniterealtime/Smack on GitHub](https://github.com/igniterealtime/Smack)
- [Issues](https://github.com/igniterealtime/Smack/issues)
- [License: Apache-2.0](https://github.com/igniterealtime/Smack/blob/master/LICENSE)
- [Project website](https://igniterealtime.org/projects/smack/)
- [README](https://github.com/igniterealtime/Smack/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/igniterealtime-smack
