`
li.oo
  • 浏览: 50271 次
  • 性别: Icon_minigender_2
  • 来自: 杭州
社区版块
存档分类
最新评论

Android-Cloud To Device Messaging(C2DM) (转发)

 
阅读更多

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

 

  • 大小: 60.1 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics