Code example for GoogleCloudMessaging

Methods: register

0
                try { 
                    if (gcm == null) {
                        gcm = GoogleCloudMessaging.getInstance(context);
                    } 
 
                    regid = gcm.register(sender_id);
 
                    // You should send the registration ID to your server over HTTP, so it 
                    // can use GCM/HTTP or CCS to send messages to your app. 
                    //sendRegistrationIdToBackend(); 
 
                    // Persist the regID - no need to register again. 
                    storeRegistrationId(context, regid);
                } catch (IOException ex) {
			ex.printStackTrace();
                } 
                return regid;
            } 
 
            @Override 
            protected void onPostExecute(String regid) {