two player turn based game android

十年热恋 提交于 2019-12-11 20:38:35

问题


I want to make a two player turn based game (think of tic tac toe) for android. I am not sure how to implement the communication between the mobile and the server. Should I use sockets or http client ? Can anybody guide. Issue with http client is I have to regularly poll the server to see if any data has arrived. Is there any other way to push the data from server if I am using http client ?


回答1:


Have you considered HTTP requests + push notifications? Depending on the particular kind of game this might be the best solution I guess...




回答2:


Why don't you check out this link for a boilerplate android/app-engine setup. Could be exactly what you need.




回答3:


You can use App Engine's Channel API

https://developers.google.com/appengine/docs/java/channel/

Even though there is no official Android library you can use this WebView wrapper

https://github.com/burcu/android-channel-api

but I haven't tested it yet.




回答4:


This is an old question but if you are still looking for a solution you could try the new Google Play Game Services.



来源:https://stackoverflow.com/questions/10734774/two-player-turn-based-game-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!