I have been reading about google Cloud Messaging and as a developer my question is " What is this for?" Can anyone provide an example of what one would use this for? Im not looking for source code. Instead I am curious about the ideas people have for its use.
From the Google Docs:
Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device
Pretty self explanatory really. It's just a mechanism for sending small messages from an external/network service to a handset for the app to act upon. It's a lot more easier than implementing a complete custom package relying on the likes of JSON or XML with a completely hand-coded protocol. (Not to say that often using tools 'off the shelf' presents a pretty elegant solution!)
In the past I was implementing a simple video podcast style app; nothing amazing - just waiting on new content from the server. In this scenario I had to specifically code things up so that the app queried the server upon launch, and then downloaded the video files. The alternative obviously being that the app queried the server every x minutes or hours.
Now with GCM I could re-write that app and have the server inform the app without the requirement for the app to initiate the action. Naturally, on a mobile this is preferable to having the app connect to the server and query it multiple times for no real reason; and it's also preferable to launching an app and having to wait whilst it requests updates from server.
The examples in the above paragraph are the obvious applications - but with some imagination it can be used for a lot more.
I think the main thing to remember though is Find a tool for the purpose, not a purpose for the tool! If you need it, it's there - but don't try and wedge it in where it's not required!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With