1 page.title=Getting Started on Android
2 page.tags=cloud,push,messaging
9 <h2>In this document</h2>
12 <li><a href="#create-proj">Creating a Google API Project</a></li>
13 <li><a href="#gcm-service">Enabling the GCM Service</a></li>
14 <li><a href="#access-key">Obtaining an API Key</a></li>
15 <li><a href="#next">Next Steps</a></li>
21 <li><a href="https://cloud.google.com/console">Google Cloud Console</a></li>
22 <li><a href="https://developers.google.com/console/help/new/">Google Cloud Console Help</a></li>
28 <p>This document tells you how to get started setting up a Google Cloud Messaging
30 Before you begin, make sure to <a href="/google/play-services/setup.html">set up
31 the Google Play Services SDK</a>. You need this SDK to use the
32 <a href="{@docRoot}reference/com/google/android/gms/gcm/package-summary.html">
35 <h2 id="create-proj">Creating a Google API project</h2>
36 <p>To create a Google API project:</p>
38 <li>Open the <a href="https://cloud.google.com/console">Google Developers Console</a>.
40 <li>If you haven't created an API project yet, click <strong>Create Project</strong>.</li>
42 <li>Supply a project name and click <strong>Create</strong>.
44 <p>Once the project has been created, a page appears that displays your project ID and
45 project number. For example, <strong>Project Number: 670330094152</strong>.</p></li>
47 <li>Copy down your project number. You will use it later on as the
48 <a href="{@docRoot}google/gcm/gcm.html#senderid">GCM sender ID</a>.</li>
51 <h2 id="gcm-service">Enabling the GCM Service</h2>
52 <p>To enable the GCM service:</p>
54 <li>In the sidebar on the left, select <strong>APIs & auth</strong>. </li>
55 <li>In the displayed list of APIs, turn the <strong>Google Cloud Messaging for Android
56 </strong> toggle to ON.</li>
59 <h2 id="access-key">Obtaining an API Key</h2>
60 <p>To obtain an API key:</p>
62 <li>In the sidebar on the left, select <strong>APIs & auth > Credentials</strong>.</li>
64 <li>Under <strong>Public API access</strong>, click <strong>Create new key</strong>.</li>
66 <li>In the <strong>Create a new key</strong> dialog, click <strong>Server key</strong>.</li>
68 <li>In the resulting configuration dialog, supply your server's IP address. For testing
69 purposes, you can use {@code 0.0.0.0/0}.</p></li>
70 <li>Click <strong>Create</strong>.</li>
72 <li>In the refreshed page, copy the
73 <a href="{@docRoot}google/gcm/gcm.html#apikey">API key</a>.
74 You will need the API key later on to perform authentication in your app server.</li>
76 <p class="note"><strong>Note:</strong> If you need to rotate the key, click
77 <strong>Regenerate key</strong>. A new key will be created. If you think the key has been
78 compromised and you want to delete it immediately, click <strong>Delete</strong>.</p>
81 <h2 id="next">Next Steps</h2>
83 <p>Once you've finished the tasks listed above, you're ready to start
84 implementing GCM. Here is an overview of the basic steps:</p>
87 <li>Implement an app server (the "3rd-party app server") to interact
88 with your chosen GCM connection server. The app server sends data to a
89 GCM-enabled Android client app via the GCM connection server. For more
90 information about implementing the server side, see <a href="server.html">
91 Implementing GCM Server</a>.</li>
92 <li>Write your client app. This is the GCM-enabled Android app that runs
93 on a device. See <a href="client.html">Implementing GCM Client</a> for more information.</li>