Thursday, August 25, 2011

C2DM Implementation Checklist Step by Step

Android C2DM helps your app server push message to your app. It's a mechanism that the server ask the mobile app to fetch new data from server and update itself. C2DM is still in beta version, or Labs version. To use C2DM with your Android applications, you must first signup to request access.

The official doc has a lot of content.
To make it clear, I make the following checklist:




1  Things Before Coding

    1.1 Create your Sender ID email account.
It's app-based. like "my-app@gmail.com"
    1.2 Signup to request access
Go to the signup page , fill the form and submit. And you'll get an email from google in minutes or hours. Some people complain that no email reply. I chose the Estimated peak queries per second (QPS) 11-100, and got an email in less than half an hour. I think google may delay your request because the requested QPS>100 or too much quota per day.

You'll got an email like this:

         
2 Android Application (Client Side)  

    2.1 Register in AndroidManifest.xml
    2.2 Send registration Intent
    2.3 Receive and handle registration result
    2.4 Send the registration ID to your server
    2.5 Receive Message
    Note: you must LOG IN your google account in order to receive message 

3 Server Side
    3.1 Receive registration ID
    3.2 Get ClientLogin Token
    3.2 Send message using ClientLogin Token

4 Notes:
4.1 C2DM makes no guarantee about delivery or order of messages
4.2 Your app can receive message without running.
4.3 C2DM require Android 2.2 or higher and Android Market app installed. If you are testing on Simulator, require Android 2.2 or higher with Google APIs SDK.
4.4 Must login Google account to receive message
4.5 The message size limit is 1024 bytes

2 comments:

  1. Hi. I'm trying to reach someone at Google to discuss C2DM quotas. Do you know anyone you can point me to? My email is srwdc@hotmail.com. Thanks.

    ReplyDelete
    Replies
    1. --18 Aug,2012
      Sorry, I don't know any c2dm googler. I just checked and found "C2DM has been officially deprecated as of June 26, 2012. This means that C2DM has stopped accepting new users and quota requests."

      The new version of C2DM, called Google Cloud Messaging for Android (GCM) http://developer.android.com/guide/google/gcm/index.html

      Find more info in google groups.
      https://groups.google.com/forum/?fromgroups#!forum/android-gcm

      Delete