I am new to Raspberry Pi and Google Cloud Messaging. What I want to do is as follows: Raspberry Pi is reading some sensor data and I want to send the data to my Android Phone in real time, i.e. as soon as a sensor reading is received it will be pushed to the phone. I looked into various ways to do this, and think using Google Cloud Messaging will be most suitable for me. So, I did the following:
1. Created a GCM project online
2. In the project, I generated a server API key with the Raspberry Pi's IP address.
3. Then ran the following program from RPi. The API in the code is the above API
For more you can check:-