GCM Sample code from https://code.google.com/p/gcm/