Code example for GoogleCloudMessaging

Methods: send

0
 
		try { 
			Bundle data = new Bundle();
			data.putString("hello", "world");
			String id = Integer.toString(mMsgId.incrementAndGet());
			mGCM.send(GCM_SENDER_ID + "@gcm.googleapis.com", id, data);
			msg = "Sent message";
		} catch (IOException e) {
			msg = "Error : " + e;
		} 
 
		displayMessageOnUI(msg);
	} 
 
	@Click(R.id.main_btn_clear) 
	void clearText() { 
		mDisplay.setText("");
	} 
}