Wednesday, May 4, 2011

Introducing the Tic Tac Toe Tutorial

This blog post introduces the Tic Tac Toe tutorial and provides links to the other parts of the tutorial, as the tutorial itself is fairly long.

Screenshot of the finished Tic Tac Toe product

Why Build Tic Tac Toe?

I can think of a number of good reasons. Maybe building Tic Tac Toe isn't your ambitious Android app goal, but by following this tutorial you will be introduced to a number of concepts that you can reuse and apply. And hopefully playing it can be a little fun.

Also, Tic Tac Toe is a great game to build because its a medium sized project. Not too lengthy and complex but not exactly trivial either. For this reason, the Tic Tac Toe tutorial will be broken down into a couple of blog posts.

Defining the Game
Before we actually get to the programming of the Tic Tac Toe game, lets set up some ground rules.
  1. The game logic must be completely separate from the Android specific display logic
  2. The player will only play against the computer
  3. The player will always be X, the computer O
  4. There app will be limited to one activity, with one XML layout
  5. There will be two levels of difficulty

The Final Product
As you read this, the final product is already available for downloading and testing on your Android Device. Check it out on the Android market with the following link:

Other Posts in the series
Android Tic Tac Toe Game Logic - Part 1 Interfaces

1 comment:

  1. Stylable not found in class

    Get the border information
    TypedArray a = context.obtainStyledAttributes(attrs,

    mBorderLeft = a.getBoolean(
    mBorderRight = a.getBoolean(
    mBorderTop = a.getBoolean(
    mBorderBottom = a.getBoolean(

    Get the row and column information
    mRow = a.getInteger(R.styleable.com_dreamdom_tictactoe_TicTacToeTile_row, 0);
    mCol = a.getInteger(R.styleable.com_dreamdom_tictactoe_TicTacToeTile_col, 0);