views:

256

answers:

4

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)

+3  A: 

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.

Adam Crossland
Thanks, I thought this might be the case, and combined with ajax, it should actually suit the design pretty well.Movement of rooms would cause a new html get and establish another AJAX connection to the new location (for local chat local actions), and other clients arleady connected would recieve notification through, and update accordingly. I guess I am just a little too new at this, but I am going to try and string together a sample app which will probably help me choose a direction to go in.Doesnt anyone know of any good tutorials that used http-based apis?
Hortinstein
Bear in mind that you cannot use 'comet' or 'long polling' on App Engine - requests are limited to 30 seconds, and if you do long polling in them, you'll run out of handlers very quickly.
Nick Johnson
A: 

You can use the Http Component classes that are in packages org.apache.http.HttpConnect.* classes in the Android SDK.

Ewan
thanks, ill look into this!
Hortinstein
+2  A: 

How about using XMPP?

d4rr3ll
XMPP is supported: http://code.google.com/appengine/docs/java/xmpp/
mjustin
+1  A: 

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.

tempy
You should also take a look at this blog post: http://googleappengine.blogspot.com/2010/04/games-on-app-engine-interview-with-jay.html
tempy