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 ?
相关问题
- Angular RxJS mergeMap types
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- Multiple sockets for clients to connect to
Have you considered HTTP requests + push notifications? Depending on the particular kind of game this might be the best solution I guess...
Why don't you check out this link for a boilerplate android/app-engine setup. Could be exactly what you need.
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.
This is an old question but if you are still looking for a solution you could try the new Google Play Game Services.