Lines Matching full:application
91 <p>This section walks you through the steps involved in writing a client-side application—that is, the GCM-enabled application that runs on an Android device. This client sample is designed to work in conjunction with the server code shown in <a href="#server">Writing the Server Code</a>, below.</p>
97 <li>The <code>com.google.android.c2dm.permission.RECEIVE</code> permission so the Android application can register and receive messages.</li>
98 <li>The <code>android.permission.INTERNET</code> permission so the Android application can send the registration ID to the 3rd party server.</li>
100 <li>The <code>android.permission.WAKE_LOCK</code> permission so the application can keep the processor from sleeping when a message is received. Optional—use only if the app wants to keep the device from sleeping.</li>
101 <li>An <code>applicationPackage + ".permission.C2D_MESSAGE"</code> permission to prevent other Android applications from registering and receiving the Android application's
102 messages. The permission name must exactly match this pattern—otherwise the Android application will not receive the messages.</li>
108 <li>If the GCM feature is critical to the Android application's function, be sure to
110 ensures that the Android application cannot be installed in an environment in which it
129 <application ...>
139 </application>
147 <p>An Android application running on a mobile device registers to receive messages by calling
150 This method registers the application for GCM and returns the registration ID. This streamlined approach replaces the previous
153 <h3 id="app"> Step 3: Write Your Application</h3>
155 <p>Finally, write your application. GCM offers a variety of ways to get the job done:</p>
159 <li>To write your client application (that is, the GCM-enabled app that runs on an Android device), use the <a href="{@docRoot}reference/com/google/android/gms/gcm/GoogleCloudMessaging.html">{@code GoogleCloudMessaging}</a> APIs as shown below. Don't forget to set up your project to use the Google Play services SDK as described in <a href="/google/play-services/setup.html">Setup Google Play Services SDK</a>.</li>
167 <p>Here is a sample client application that illustrates how to use the <a href="{@docRoot}reference/com/google/android/gms/gcm/GoogleCloudMessaging.html">{@code GoogleCloudMessaging}</a> APIs. The sample consists of a main activity ({@code DemoActivity}) and a broadcast receiver ({@code GcmBroadcastReceiver}). You can use this client sample code in conjunction with the server code shown in <a href="#server">Writing the Server Code</a>.</p>
177 <p>An Android application needs to register with GCM servers before it can receive messages. So in its {@code onCreate()} method, {@code DemoActivity} checks to see whether the app is registered with GCM and with the server:</p>
233 * Gets the current registration id for application on GCM service.
261 * @return Application's {@code SharedPreferences}.
271 * @return Application's version code from the {@code PackageManager}.
306 * Registers the application with GCM servers asynchronously.
309 * application's shared preferences.
349 * application's {@code SharedPreferences}.
351 * @param context application's context.
450 <p>Here is an example of a CCS server written in Python. You can use this in conjunction with the sample client code shown above. This sample echo server sends an initial message, and for every upstream message received, it sends a dummy response back to the application that sent the upstream message. This example illustrates how to connect,