首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > 云计算 >

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

2012-09-12 
Android-Cloud To Device Messaging(C2DM) (转发)C2DM Implementation Checklist Step by Step Android C2

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:

Android-Cloud To Device Messaging(C2DM) (中转)
?

?????????
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

?

热点排行