I am trying to establish device to device messaging using Google Cloud Messaging. I tried using socket programmng, but the connection used to get lost everytime I moved to the next page. Thus I am using GCM. The plan is to send a message from client's phone and it should be displayed on server's phone, using 3g/wifi and not bluetooth.
I am referring the following link for the same:
It has no errors and is running, but nothing is displaying on the screen. Also a few doubts:
- In the code in CommonUtilities.java what should be the Server_Url? I am using XAMPP, so should it be XAMPP's URL?
- Also, what should be the Sender_ID?
- Also in MainActivity.java, what should be the device IMEI? Do we have to enter that manually, or will the device fetch on ots own.
- Also in the php files, its written enter "GCM Registeration ID got from device".Is it client's ID? I am running using Google API and registering my ID in the settings of the emulator before proceeding further.
Can anyone please tell me where am I going wrong? Or even if you have a better idea, please do share here. I am looking for mobile to mobile communication only, not using push notifications.