Push notifications are officially awesome for real time multiplayer gaming. If your server has no other players, you can't really have a game. With push notifications however, you can register your interest in playing, and whenever someone logs in, you can immediately be told and be able to log right in and play against them.
Some of the quirks of getting push notifications on Android were.
- Including the gcm.jar file compiled but always gave me a class not found run time error.
- To solve, I included the source files provided in gcm-client instead.
- GCMIntentService must be put in the same class package as your application package. (I tend to re-use a lot of my code between projects, so I have a generic class package name with different application package names).
- The provided gcm-server code is Java based.
- My server was node js. Luckily there was a nodeJS GCM module to the rescue.
https://github.com/ToothlessGear/node-gcm
Apart from that, everything seemed to pretty much work well.
Some good material to get your head around is the Google I/O 2012 talk and the documentation.
If you're doing push messaging with NodeJS and have any problems, let me know and I'll try to help. If you hate server side development, you can always give Parse a try.
nice idea :)
ReplyDelete-luca
This might help with the classpath problem:
ReplyDeletehttp://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android/9916751#9916751
=> rename "lib" to "libs"
Seems to be an issue with the ADT.
That's it! If you're on SDK 18+, you need to move all your jars into the root of the libs folder.
ReplyDeleteGrr.