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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值