Google provides several samples to help you with GCM development.
Messaging app example
For an example of GCM running in the context of a simple messaging application that combines GCM with Analytics, Sign In and AdMob APIs, see Friendly Ping. This sample includes example app server implementations in Java and Go.
Server "playground" example
The GCM Playground provides a reference implementation of a GCM app server in the form of a playground that developers can use to test the Google Cloud Messaging Service.
For an example of how to use the
GcmNetworkManager API to schedule reliable
network tasks in your application, see the GcmNetworkManager quickstart sample.
Android demo app
The GCM Android demo app on GitHub demonstrates a range of Google Cloud Messaging features, including topic messaging, upstream messaging, and scheduling tasks with the Network Manager.