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.