Android Pusher Library Hits 1.0.0

We are excited to announce that we have published a major release of pusher-websocket-java, our library targeting Android and general Java. We thought our library, given its stability and use by many large customers in production, deserved a 1.0 release.

This blog post will provide a quick overview of how to use the Android library, and what you can do with it.


For Gradle, add the following to your app’s build.gradle:

repositories {
  maven { url '' }

dependencies {
  compile 'com.pusher:pusher-java-client:1.0.0'

For Maven, just create a dependency node in your pom.xml, between two dependencies tags:




Getting Started

Firstly, to initialize the client, create a new Pusher instance with your app key, which you can get by signing up for a free account, and calling connect() on the new object:

import com.pusher.client.Pusher;

Pusher pusher = new Pusher("YOUR_APP_KEY");


To start subscribing to a channel, call subscribe and pass in your channel name. Then we can start listening for events by binding to your specified event name and passing a new SubscriptionEventListener:


// subscribe to channel
Channel channel = pusher.subscribe("my-channel");

// listen for an event
channel.bind("my-event", new SubscriptionEventListener() {

    public void onEvent(String channelName, String eventName, final String data) {


You can test this by sending messages with our Debug Console on your dashboard.

Over To You

You can find out much more via the Github repo. If you find anything lacking in the library, or room for improvement, please do send us a pull request!

We also released a tutorial on how to build an Android Chat app using the new library.

Ready to begin?

Start building your realtime experience today.

From in-app chat to realtime graphs and location tracking, you can rely on Pusher to scale to million of users and trillions of messages