In this tutorial we show how to create a push-enabled application.


We assume that the developer already owns an account into the ArenaDaemon web platform and

owns the knowledge for creating a new application and retrieving the correspondent appKey.

Moreover, we assume that a valid GCM Api Key and Sender ID has already been created and setup

in order to make the push service working.


For more information about how to create a developer account and for setup a new application,

please refer to the chapter "Create an appKey".

For more information about how to setup a GCM Api Key and Sender ID,

please refer to the chapter "Push Notifications: Setup".


The implementation steps to perform for building a working push enabled application are few and

very simple.


The first step is the initial SDK setup and involves only the AndroidManifest

More in depth the following lines have to be added:



    <uses-permission android:name="android.permission.WAKE_LOCK"/>

    <uses-permission android:name=""/>


    <permission android:name="<>.permission.C2D_MESSAGE"


    <uses-permission android:name="<>.permission.C2D_MESSAGE"/>






        <meta-data android:name=""



        <service android:name="com.bitdrome.bdarenaconnector.gcm.PushService"/>






                <action android:name=""/>

                <category android:name="<>"/>




        <!-- Use the built-in Broadcast Receiver -->

        <receiver android:name="com.bitdrome.bdarenaconnector.gcm.ArenaPushBroadcastReceiver" 



                <action android:name="com.bitdrome.bdarenaconnector.push.intent.OPEN"/>




        <!-- Use this to customize the notification icon -->








 In the onCreate method of the MainActivity class you have to perform the Arena authentication:





    protected void onCreate(Bundle savedInstanceState) {





            "<YOUR_APP_KEY>", false);


        BDArenaConnector.getInstance().registerEventsObserver(new ArenaHandler());





With these basic calls, the application will be completely able

to manage incoming push notifications. For the sending operations, two methods are available

through the BDArenaPush class: sendPushToPlayer and sendPushToChannel


Moreover, the local player can subscribe and unsubscribe to and from channels simply calling 

subscribeToChannel and unsubscribeFromChannel methods.


Sample project

Download the sample project for this tutorial.