How to Build a Tic Tac Toe Game in Android? (original) (raw)
Last Updated : 23 Jul, 2025
In this article, we will be building a Tic Tac Toe Game Project using **Java and **XML in Android. The Tic Tac Toe Game is based on a two-player game. Each player chooses between X and O. The Player plays one move at a time simultaneously. In a move, a player can choose any position from a 3x3 grid. The goal here is to get three consecutive X or O in a horizontal, vertical, or diagonal direction. There will be a single activity in this application. This activity will show a 3x3 grid. The status of the game will be displayed at the bottom.
**Step-by-Step Implementation
**Step 1: Create a New Project
To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select **Java as the programming language.
**Step 2: Before going to the coding section first you have to do some pre-task
**Add Images: All the images are listed below. Save them in your drawable folder in resources. Go to the **app > res > drawable and paste the following files:
**Change the style to NoActionBar in the themes.xml file:
<style name="Theme.Test_Layouts" parent="Base.Theme.Test_Layouts" />`
**Output:
Final Application to Build a Simple Notes App
**Note: The Application we have created is like a template for your Notes Application you can make changes in it as you want.
The GitHub Link for the Application is : Click Here to access the Complete Code for Tic Tac Toe Android Application