Developing Android networked game, is it feasible to use App Engine for a server
I have been looking into android development for some time and would really like to create a networked game. I also think this would be an excellent oppurtunity to familiarize myself with the app engine framework, but it seems more app engine applications are built around browser services.
This is not nessecarily a problem for me, but I do not want this to appear as 开发者_运维问答a browser based game (I want live chat, more dynamic interaction/movement/combat). I have been looking into AJAX/Java as a possible solution, but I am having trouble visualizing how i will actually connect the app to the server, since all tutroials I have found seem to be hosted web applications. Are there any resources for android applications hooking transparently into App Engine services?
Or maybe there is a better service similar to app engine I should look into.
Thanks! (if i was unclear about anything let me know)
AppEngine is completely prejudiced towards delivering web applications: HTTP in, HTTP out. So, as long as you can design your game's communication layer to be implementable in HTTP (stateless, finite-life requests) there's no reason that this wouldn't work.
Your game doesn't have to run in a browser to use an HTTP-based API to communicate with the server. I doubt that there are any special "transparent" communication libraries between Andriod and AppEngine, as the web request-style of communication that is possible with AppEngine is effectively indistinguishable from the same techniques that would be used to communicate with any other HTTP-based API running on any platform.
I'm currently developing an application that will involve a browser based webapp and also an iphone "installed app" (that's google's terminology) that connects to the GAE service. I simply GET/POST xml to a basic servlet and it works fine. Just keep in mind that to keep the client snappy, you will have to use memcache extensively as even minor calls to the datastore tend to to take a long time, and a "waiting" dialog in an installed app starts to get old very quickly. I would try to use memcache (as opposed to datastore) extensively to hold game-state data, since this data probably doesn't need to be "permanently" persisted, and memcache is significantly faster than the datastore.
Also I don't think there's any way for clients to be notified of game-state changes, app engine doesn't do "push," so all the clients will have to poll for updates.
You can use the Http Component classes that are in packages org.apache.http.HttpConnect.* classes in the Android SDK.
精彩评论