Setting up and configuring GCM for your application

To setup Google Cloud Messaging on your application you will have to register with GCM and set up a Google API Project on your Google Developers Console (https://developers.google.com/mobile/add):

  1. First pick Android App Platform
  2. Specify your application name

    Example: Asynchronous Android

  3. Supply your application package name

    Example: com.packpublishing.asynchronousandroid

  4. Select Cloud Messaging Services and Enable Google Cloud Messaging
  5. Generate the configuration files and download the JSON configuration file google-services.json to your computer.
  6. Save your credentials (Server APIKey, SenderId) to authenticate with the GCM platform

Once you have registered your application with GCM, get the google-services.json ...

Get Asynchronous Android Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.