What is GCM? Push: lightweight message toGCM (Google Cloud Messaging) is applications telling that there isa free service that helps new data to be fetched from thedevelopers send data from servers server or a message containingto their Android applications on up to 4kb of payload data (e.g:Android devices. instant messaging apps). This can eliminate continuous query to server for updates using background services
GCM Characteristics Allows 3rd-party GCM makes noapplication servers to send guarantees about deliverymessages to their Android or the order of messages.applications. Application on an Android device doesnt need to be running to receive messages.
Google API Console1.Creating a Google API project2.Enabling the GCM Service http://developer.android.com/google/gcm/gs.html3.Obtaining an API Key
Writing the Android Client ICopy the gcm.jar file into your application classpath.
Writing the Android Client IIWrite the my_app_package.GCMIntentService classWrite your applications main activity
MigrationAndroid Cloud to DeviceMessaging (C2DM) isdeprecated. GCM replaces C2DM The focus of GCM is as follows: * Ease of use. No sign-up forms. * No quotas. * GCM and C2DM stats are available through the Developer Console. * Battery efficiency. * Rich set of new APIs.
Client changesServer changes Sending messages to GCM devices requires a few changes: * The request should be sent to a new endpoint: https://android.googleapis.com/gcm/send. * The Authorization header of the request should contain the API key generated during sign up. This key replaces the deprecated ClientLogin Auth token.