Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A simple pusher implementation and activity for Android!
Pull request Compare This branch is 25 commits ahead, 1 commit behind linki:master.


This code provides a simple implementation allowing for an Android 1.6+ app to receive realtime events from

This project makes use of a slightly modified Weberknect, available at

Special thanks to and for giving me the opportunity to write and open source this!

This project is under the Apache License, Version 2.0!

To get started receiving events from your Pusher account:

  • Clone this repository locally
  • Sign up for an account at
  • Download Eclipse and the Android SDK from
  • Open the project in Eclipse (Using File > New Project > From Existing Source)
  • Open, and find the constants PUSHER_APP_KEY and PUSHER_CHANNEL_1
  • Change these constants to your assigned Pusher app key and your first channel.
  • Run the application on a device or emulator, and send messages from your Pusher console.
  • To add more channels, duplicate the existing code that handles inbound.
  • To handle multiple event types, modify the Activity's mHandler.handleMessage() function, checking the "type" string of the incoming event.

Quick Example of the new API:

Pusher pusher = new Pusher( "pusher_key" );
final Channel channel = pusher.subscribe( "chat-channel" );
channel.bind( "new_message" , new PusherCallback() {
  public void onEvent(JSONObject eventData) {
    Log.d( "Pusher", "Received " + eventData.toString() + " for event 'new_message' on channel " + );
    myTextField.setText( eventData.getString("content") );

you can bind to any event of a channel as long as you are subscribed to it:

channel.bindAll(new PusherCallback() {
  public void onEvent(String eventName, JSONObject eventData) {
    Log.d( "Pusher", "Received " + eventData.toString() + " for event '" + eventName +"' on channel " + );

bind() and bindAll() also work on the pusher instance, in order to retrieve events from all channels

pusher.bindAll(new PusherCallback() {
  public void onEvent(String eventName, JSONObject eventData) {
    Log.d( "Pusher", "I will show up on any event on any subscribed channel" );

For support, visit

Something went wrong with that request. Please try again.