Getting Started

Autobahn|Android implements version 1 of WAMP.

This is incompatible with version 2 of WAMP which is already implemented in Autobahn|Python as well as Autobahn|JS

Migration of Autobahn|Android to WAMP v2 is coming, but we cannot guarantee a release date.

This short intro will get you started with Autobahn|Android in no time:

  • Installation
  • Your first Client
  • Where to go now



Autobahn|Android is written against the Android 2.2 platform (= API level 8). You can use it with projects built against that version or higher.

Autobahn|Android depends on Jackson, a high-performance JSON processor. AutobahnAndroid is known to work with Jackson 1.8 and 1.9.

Set Compiler Level

Make sure the Java compiler compliance level is set to (at least) 1.6 in your project settings:


Add JARs to your project

To use Autobahn|Android , you will need 3 JARs:

You can also get a complete bundle of AutobahnAndroid and Jackson JARs.

. note:: Autobahn|Android is also available as source code on GitHub.

Put the 3 above JARs into your project’s libs folder


and add the JARs to the project’s build path


Set App Permissions

Make sure the Manifest for your application contains the android.permission.INTERNET

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="" ...>

    <uses-permission android:name="android.permission.INTERNET">

    <application ...>

Your first Client

Create a new Android project and replace the main activity code with the following:

package de.tavendo.test1;

import android.os.Bundle;
import android.util.Log;
import de.tavendo.autobahn.WebSocketConnection;
import de.tavendo.autobahn.WebSocketException;
import de.tavendo.autobahn.WebSocketHandler;

public class Test1Activity extends Activity {

   private static final String TAG = "de.tavendo.test1";

   private final WebSocketConnection mConnection = new WebSocketConnection();

   private void start() {

      final String wsuri = "ws://";

      try {
         mConnection.connect(wsuri, new WebSocketHandler() {

            public void onOpen() {
               Log.d(TAG, "Status: Connected to " + wsuri);
               mConnection.sendTextMessage("Hello, world!");

            public void onTextMessage(String payload) {
               Log.d(TAG, "Got echo: " + payload);

            public void onClose(int code, String reason) {
               Log.d(TAG, "Connection lost.");
      } catch (WebSocketException e) {

         Log.d(TAG, e.toString());

   public void onCreate(Bundle savedInstanceState) {



Now start a WebSocket echo server on some host and adjust line 18 for the IP of the host.


You can use any WebSocket server that implements WebSocket RFC6455 or at least Hybi-10+. A WebSocket server that only implements Hixie-76 will not work.


For this demo, on the WebSocket server you will need to implement “echo”, so that any message sent to it is simply echo’ed back to the client. I.e. you can use the server provided with the WebSocket Echo server example that comes with Autobahn|Python .

Build and run the app. You should see the following in the Android device logcat:


Where to go now

Now that you are up and running, check out the Examples available or the API reference.

Reactive Manifesto: We are reactive banner