I’m studying the use of threading in the Lunar Lander sample code, and I’m getting the hang enough to use it, but the developer website doesn’t seem to go that in depth about what each piece of code does, and the comments in the code don’t really explain that much. I’ve searched for a more in depth tutorial or walk-through on this code but I can’t seem to find one. I’d like to get a better grasp on threads and changing the game state, etc.
Does anyone know of a good source on this (preferably free), or if not just a thorough tutorial that would cover understanding how pretty much everything in the LunarLander.java file works?
Edit: as per request, here is the referenced sample code: http://developer.android.com/resources/samples/LunarLander/index.html
I’m not particularly familiar with Android, so please forgive me if I’m missing the mark with this answer.
That being said, if Android and the LunarLander example uses the same concurrency mechanisms built in to Java, you may find this threading tutorial useful.
http://javamex.com/tutorials/threads/
There’s also a good deal of info about synchronization and concurrency here:
http://javamex.com/tutorials/synchronization_concurrency_1.shtml