Code example for GoogleCloudMessaging

Methods: register

0
	            String msg = "";
	            try { 
	                if (gcm == null) {
	                    gcm = GoogleCloudMessaging.getInstance(context);
	                } 
	                regid = gcm.register(SENDER_ID);
	                msg = "Device registered, registration id=" + regid;
 
	                postToServer(regid);
	                setRegistrationId(context, regid);
	            } catch (IOException ex) {
	                msg = "Error :" + ex.getMessage();
	            } 
	            return msg;
	        } 
	    }.execute(null, null, null);
	} 
	 
	/** 
	 * Stores the registration id, app versionCode, and expiration time in the