GCM4Public - GCM for Public

This is an open-source project providing service to collect GCM client registrations and sending to all of them a GCM message when needed.

Please fill this form with your details to send message to your users

It is prefilled with sample data. Devices which has GCM4Public-Client installed will receive this message if you won't provide different senderId and API key. Please don't be spammy and provide your correct data.



GCM4Public open-source GCM service

The event

During the +GDG Vilnius event  Hackathon: Google Cloud Messaging for Android, this open source project was created:

The server

The Demo Android application using this GCM4Public service is open here:

This is the Java class which sends GCM message:

The client

To use Google Cloud Messaging for Android you need to register at Google's API console:

This is the Java class responsible for handling GCM messages and registers on GCM4Public server:

Here you can see how device initiates registration on the GCM:

Sending messages

You'll get the project number (aka senderId) and API Key. These two are used in this service to send GCM notifications. And you need to provide it in this form: https://gcm4public.appspot.com/

The service is secure, because only senderId and phones registrationId are stored. The API key is not saved on server and you need to provide it every time you want to send a message to the server.
The senderId is used to filter app's users, so one application would not disturb other's users.

Multiple applications can use this single server: https://gcm4public.appspot.com/

Google App Engine

It's running on Google App Engine so it has some limitations, but I think, it might be running ok for few hundred small apps. If you have tens of thousands users, please fork the project on github and put on your separate Google App Engine account with separate daily limits.

Other resources

Blog post: http://www.andro.lt/2012/11/google-cloud-messaging-for-android.html

Google Cloud Messaging for Android by Francesco Nerieri:

and get the slides here:

If you want to read more, here is the link on developer.android.com about GCM for Android: