An often overlooked addition to Android 2.2 is Cloud to Device Messaging (C2DM), which enables developers to push small data messages to the phone. This is the brains behind Chrome to Phone, a Chrome extension which allows the user to send links and other information to their Android device right from their browser. The process works as follows:
- The Android Application registers with the C2DM service and gets a device registration ID for the user. It sends this registration ID along with the user’s account name to the AppEngine server.
- The AppEngine server authenticates the user account and stores the mapping from account name to device registration ID.
- The Chrome Extension accesses the URL and page title for the current tab, and POSTs it to the AppEngine server.
- The AppEngine server authenticates the user and looks up the corresponding device registration ID for the user account name. It then HTTP POSTs the URL and title to Google’s C2DM servers, which subsequently route the message to the device, resulting in an Intent broadcast.
- The Android application is woken by its Intent receiver. The Android application then routes the URL to the appropriate application via a new Intent (e.g. browser, dialer, or Google Maps).
Again, this requires Android 2.2, so for all of you who are officially/unofficially running Froyo, you can download both the Chrome extension and the Android APK here.
[via Android-Developers]








Comments