# autobahnandroid
**Repository Path**: mirrors/autobahnandroid
## Basic Information
- **Project Name**: autobahnandroid
- **Description**: WebSocket & WAMP in Java for Android and Java 8
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 0
- **Created**: 2017-04-02
- **Last Updated**: 2026-02-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# **Autobahn**|Java
Client library providing [WAMP](http://wamp-proto.org/) on Java 8 ([Netty](https://netty.io/)) and Android, plus (secure) WebSocket for Android.
[](https://hub.docker.com/r/crossbario/autobahn-java/)
[](https://travis-ci.com/crossbario/autobahn-java)
[](https://javadoc.io/doc/io.crossbar.autobahn/autobahn-android)
---
Autobahn|Java is a subproject of the [Autobahn project](http://crossbar.io/autobahn/) and provides open-source client implementations for
* **[The WebSocket Protocol](http://tools.ietf.org/html/rfc6455)**
* **[The Web Application Messaging Protocol (WAMP)](http://wamp-proto.org/)**
running on Android and Netty/Java8/JVM.
The WebSocket layer is using a callback based user API, and is specifically written for Android. Eg it does not run any network stuff on the main (UI) thread.
The WAMP layer is using Java 8 **[CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html)** for WAMP actions (call, register, publish and subscribe) and the **[Observer pattern](https://en.wikipedia.org/wiki/Observer_pattern)** for WAMP session, subscription and registration lifecycle events.
The library is MIT licensed, maintained by the Crossbar.io Project, tested using the AutobahnTestsuite and published as a JAR to Maven and as a Docker toolchain image to Dockerhub.
---
## Download
Grab via Maven:
```xml
io.crossbar.autobahnautobahn-android21.7.1
```
Gradle:
```groovy
dependencies {
implementation 'io.crossbar.autobahn:autobahn-android:21.7.1'
}
```
For non-android systems use artifactID `autobahn-java` or just
Download [the latest JAR](https://search.maven.org/remote_content?g=io.crossbar.autobahn&a=autobahn-java&v=LATEST)
## Getting Started
The demo clients are easy to run, you only need `make` and `docker` installed to get things rolling.
$ make crossbar # Starts crossbar in a docker container
$ make python # Starts a python based WAMP components that provides calls for the Java demo client
and finally
$ make java # Starts the java (Netty) based demo client that performs WAMP actions
## Show me some code
The code in demo-gallery contains some examples on how to use the autobahn library, it also contains convenience methods to use. Below is a basic set of code examples showing all 4 WAMP actions.
### Subscribe to a topic
```java
public void demonstrateSubscribe(Session session, SessionDetails details) {
// Subscribe to topic to receive its events.
CompletableFuture subFuture = session.subscribe("com.myapp.hello",
this::onEvent);
subFuture.whenComplete((subscription, throwable) -> {
if (throwable == null) {
// We have successfully subscribed.
System.out.println("Subscribed to topic " + subscription.topic);
} else {
// Something went bad.
throwable.printStackTrace();
}
});
}
private void onEvent(List