My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Welcome

This is the source code for all the examples and games in the book "Beginning Android Games", written by Mario Zechner, published by Apress in April 2011. The book is available directly from Apress, from Amazon and various other outlets.

Quickstart Video

Setting Up the Development Environment

For the code to run you will need:

Installing the JDK and Eclipse is straight forward. For the former just execute the setup program, for the later unzip the zip file to a folder of your choice and run the Eclipse executable.

Installing the Android SDK and the ADT plugin is described here and here. The book also explains how to set everything up.

Getting the Code

The first thing you want to do is downloading the code. For this you'll need to install a Subversion client.

  • Windows: Tortoise SVN
  • Linux/Mac OSX: command line installation of Subversion

Once you have your prefered SVN client, just point it at http://beginning-android-games.googlecode.com/svn/trunk/ and check out all the Eclipse projects for each chapter.

Importing the Projects to Eclipse

Next you want to import the projects into Eclipse

  1. Open Eclipse and create a new workspace (File -> Switch Workspace -> Other... then just select a (new) empty directory)
  2. Wait for Eclipse to reload, close the "Welcome" View (click the "x" in the upper left corner).
  3. Goto File -> Import, in the dialog select General -> Existing Projects into Workspace. Then click "Next".
  4. In the next dialog select the root directory which is the one you downloaded the projects to. Once selected you should see a list of projects marked for import.
  5. Check "Copy projects into workspace" and then finish the operation by clicking "Finish".
  6. Once Eclipse is done importing the projects you should see the projects in your package explorer.
  7. If the projects contain errors you have to go to Project -> Clean, select "Clean all projects" in the upcoming dialog, and press the "OK" Button. This will rebuild all the projects and make sure that all Android specific resources are created.
  8. profit :)

Running the examples

That's the easy part! I assume you either have a device connected or created an emulator already as explained in the book (or the Android developer guide).

  1. Right-click on the project you want to run and select Run As -> Android Application
  2. In the upcoming dialog (if you have multiple devices/emulators connected) select the device/emulator you want to run the project on
  3. The project should now run happily on whatever device/emulator you selected.

Reporting Problems

In case you stumble upon a potential bug (no code is perfect) please use the issue tracker and file an issue. Just fill out the template so i can reproduce the problem and i'll have a look at it. The fixed version will be commited to SVN and you can simply fetch an update with your SVN client.

Discussion

For discussion of the book and its code use the forums over at http://badlogicgames.com/forum/viewforum.php?f=21. Share your games, questions and ideas!

Powered by Google Project Hosting