Member-only story

Build Tic-Tac-Toe Game on Android Studio — Tutorial

Dhaval Thakur
3 min readNov 19, 2021

--

In this tutorial, we will develop a super cool Tic-Tac-Toe in android studio that is impossible to beat.

Must be thinking why impossible! Because we are going to use Artificial Intelligence in this game.

Creating Tic-Tac-Toe in Android Studio

  1. Create a new project by going to File ⇒ New Android Project. and fill the required details.
  2. Implement your main Activity class from TicTacToe.OnInitListener
  3. Now add following code your class

Creating Game UI:

First, you need some drawable resources to make the UI as you see below. You can get drawable from this link.
After downloading the drawable paste them inside the drawable folder of your project.
Now define the following colours in your colors.xml file.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3991aa</color>
<color name="colorPrimaryDark">#184b5a</color>
<color name="colorBackground">#26697c</color>
<color name="colorAccent">#0A3664</color>

activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout

--

--

Dhaval Thakur
Dhaval Thakur

Written by Dhaval Thakur

Data Enthusiast, Geek, part — time blogger. Every week 1 new Data Science/ Product Management story 🖥 I also write on Python, scripting & blockchain

No responses yet