I'm currently developing an App and as I implemented the C2DM feature it got me thinking how does this work?
Does it work via polling? Is there a hidden SMS? How are they pushing the Message on my device?
Based on this document: And this is basically how other push notification services work as well...
On the C2DM side, the token is associated with a specific device. When you send a push notification through C2DM, the Google servers send that info to the device. C2DM libraries on the device "listen for them" and pass them on to the intents as needed.
Android provides system-wide intents for such type of app triggering. For C2DM, there's a whole class of intents looks like com.google.android.c2dm.*. To use these intents, you'll need to add broadcast receivers in your app and register it with system.
To make it really work, you'll need remote push service too. Your software on server must be capable of messaging to Google's C2DM server using HTTP/HTTPS.
Now, whenever a push protocol based communication from C2DM server is established, Android system triggers app based on intents registered at the time of app installation...
More clearly, when your application push server pushes message to Google's C2DM server, Google checks token attached with message. Mind it, this token was generated by com.google.android.c2dm.intent.register if user had logged in with Google Account. So, using this token, Google comes to know exact delivery location. Then, Google makes use of Google Services Framework to push message in raw key-value pair format...
Polling or not?
No. It utilities same email push type technology in which connection between server & client is kept open. So, no need to run polling service..