Let’s make an Android App for Tic-Tac-Toe
Many of you would have played Tic Tac Toe game! If you haven’t played this interesting game then please check out this video on what is Tic Tac Toe and how to play this game?
This is a beginner-friendly step by step guide on how to develop a tic tac toe game on android.
Prerequisites
- Install Android Studio on your system
- Basic knowledge of any programming language like C, C++, Java.
1. Prepare the UI of the app

For making the basic frame for the game, we will use 9 Buttons and some Textviews.
Note- The UI/UX of the app can be improved anytime, I will give more emphasis on the proper functioning of the app.
Open the .xml file in your android studio. Write this code to design the layout
2. Mapping the Design with Code
In this part we will write the code to map the UI (i.e XML) of the app with the logic.
3. Handling Button Clicks and Implementing game logic
This part focuses on action to be executed on clicking the buttons of the Board.
4. Code for Winner Logic
5. Complete Code
Here is complete code for Tic Tac Toe game.
For source code on Github, visit here.
6. Test your App
Congratulations! You have successfully developed the Tic Tac Toe game.
Now you can test your app on emulator or android device
Check out this video on Tic Tac Toe by Pulkit Aggarwal, Mentor at Coding Blocks.
Interested in building more such Android Projects, Fullstack Web Development Projects or Machine Learning Projects? Check out our online courses on Coding BLocks.
Thanks for reading! If you enjoyed this story, please click the 👏 button 50 times and share to help others find it! Feel free to leave a comment 💬 below.
Have feedback? Let’s connect on Twitter.