开发者

What is the best practice for implementing smack into an android app?

开发者 https://www.devze.com 2023-03-10 07:47 出处:网络
I\'m writing an android game that requires push notification. I\'ve got the aSmack library imported and working, but I don\'t know how to implement it efficiently to achieve the following:

I'm writing an android game that requires push notification. I've got the aSmack library imported and working, but I don't know how to implement it efficiently to achieve the following:

1.) Each player should be notified when the other player makes a move. 2.) The server should be notified each time either player makes a move, in or开发者_开发百科der to avoid any cheating (such as one player making two moves in a row, etc.)

I've got openfire and aSmack connecting with each other. I need to write a server side program to handle the server-side. Should I put the two users and the server in a group chat? Would it better to have three individual chat sessions?


I think you want to take a look at XMPP Pubsub.

For C2DM: IIRC it won't suit your use case, as it provides no back channel (only push TO the devices are possible)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号