two player turn based game android

2019-09-12 02:02发布

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 ?

4条回答
神经病院院长
2楼-- · 2019-09-12 02:40

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

查看更多
小情绪 Triste *
3楼-- · 2019-09-12 02:49

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

查看更多
混吃等死
4楼-- · 2019-09-12 02:52

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.

查看更多
相关推荐>>
5楼-- · 2019-09-12 02:53

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

查看更多
登录 后发表回答