Google's C2DM for gaming
I've been looking at Google's C2DM service for push notifications for an Android Application. However, in my scenario, my application is a game. 开发者_开发技巧Do you think C2DM would be infeasible for pushing game state notifications to my mobile game clients from the server? I'm developing a game as a project but it will not be a commercial game. Just a prototype.
If C2DM will not suffice, do you have any suggestions for pushing game state from a server to a multiplayer game running on an android phone? I've explored a TCP/IP connection but I've a feeling this will hammer the batter power. Polling initiated by the client won't be efficient as I need real-time updates.
Any advice greatly welcomed Thanks
Note that to prevent abuse/misuse of C2DM, Google puts limitation on the overall number of pushes a single developer can send over a period of time and the number of pushes a single developer can send to a single user.
C2DM are not meant for high traffic updates, if your game will require updates every 5 minutes or more, then you should just maintain an open TCP connection yourself, it won't be that battery expensive since in that case it is likely the screen and CPU will take the most power. However, if your game is a real-time game (i.e. the game progresses in real time, irrespective of whether the user is logged on or not; not real time in the sense of RTS), and you only need to push updates once every couple hours or so, then C2DM will be quite suitable.
Accounts limits are set individually and these limits can be confirmed or increased on request. For example, I have a c2dm account which has a limit of "just" 100,000 c2dm messages per day. So far, I think the most I have used is about 60 (a day). I am also writing a game that uses c2dm for messaging (moving from google talk messages - which is a right cluster). I was actually advised to used c2dm by Reto of google fame - so I am hoping its suitable !! What is your game btw?
精彩评论