0% found this document useful (0 votes)
254 views34 pages

Micro Project Mad

This document is a micro-project report submitted by Akshata Revoor for developing an Android application for a Tic-Tac-Toe game. The report includes the project proposal, literature review, code snippets, and certification from the project guide and head of the computer department. The project aims to learn Java programming, understand Android app development, and enhance problem-solving skills. The proposed methodology includes designing the user interface, implementing game logic, testing, and deploying the app.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
254 views34 pages

Micro Project Mad

This document is a micro-project report submitted by Akshata Revoor for developing an Android application for a Tic-Tac-Toe game. The report includes the project proposal, literature review, code snippets, and certification from the project guide and head of the computer department. The project aims to learn Java programming, understand Android app development, and enhance problem-solving skills. The proposed methodology includes designing the user interface, implementing game logic, testing, and deploying the app.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Ajeenkya D Y Patil School of Engineering (Charholi)

Via Lohegaon, Pune-412 105

Department of Computer Engineering


2023-24[6thSem]

Micro-project Report of

Mobile Application Development on

Android Application For TIC-TAC-TOE Game


Submitted by:

Roll Number Name of Student Enrollment Number

06 Akshata Revoor 2116490083

Under the Guidance of

Mrs.Sumoli Vaje
Ajeenkya D Y Patil School of Engineering (Charholi)
Department of AIML Engineering
SEMESTER-6th 2023-24

CERTIFICATE
This is to certify that Project report entitled "Android application for TIC TAC
TOE game " is submitted in the partial fulfilment of requirement for the award of the
Diploma in Computer Engineering by Maharashtra State Board of Technical Education
as record of students' own work carried out by them under the guidance and supervision
at D Y Patil School of Engineering (Charholi), during the academic year
2023-24.

Roll Number Name of Student Enrollment Number

06 Akshata Revoor 2116490083

Place: Charholi (Bk)


Date: / /2024

(Mrs. Sumoli Vaje) (Mr. Sandeep Pandey )


Project Guide Head of Computer Department
ACKNOWLEDGEMEMT

It is with profoundly sense of gratitude that we acknowledge from


our guide Mrs. Sumoli Vaje. She has been guided in the true sense of word,
a guide who satisfaction from our word & progress.

We are highly obliged to Mr. Sandeep Pandey Head of Computer


Department for aberrance & good co-operation given to us for bringing
this project to almost standard.
We are grateful to our principal Dr. shelke sir for proceeding
acknowledgement to us in the connection of this project concluding. We
appreciate the assistance of all staff that helps us in for their sincere &
obliging help to make our project successfully.
Micro Project Proposal
Part-A

1. Aims/Benefits of the Micro-Project:


•Learning Java programming language: Developing an android application using Java
language can be a great way to learn the language. Java is widely used in android app
development, and gaining expertise in it can lead to better career opportunities.

•Understanding android app development: By working on a microproject like developing


an android app, one can gain a good understanding of android app development concepts
like activities, layouts, and user interface design.

•Enhancing problem-solving skills: Developing an android app involves identifying and


solving various programming challenges. By working on such a microproject, one can
develop better problem-solving skills.

•Practical application of programming concepts: Developing an android app for tic-tac


toe game requires the application of programming concepts like loops, conditional
statements, and user input/output. By applying these concepts practically, one can
solidify their understanding.

•Showcasing skills: Completing a microproject like developing an android app can serve
as a great addition to one's portfolio. It can showcase one's programming skills and
experience to potential employers or clients.

•Fun and engaging project: Developing a tic-tac-toe game app can be a fun and engaging
project that can motivate learners to continue exploring programming and android app
development.

2. Course Outcomes Achieved:

• Familiarity with Android Studio and Java programming language.

• Understanding of the basics of Android UI components and layouts.


3.Proposed Methodology:

• Understanding the requirements: The first step is to understand the requirements of the
tic-tac-toe game app. This includes understanding the rules of the game, the user
interface design, and the features to be included in the app.

• Creating a project in Android Studio: Next, create a new project in Android Studio,
select the minimum SDK version and target SDK version, and choose the basic app
template.

• Designing the user interface: Design the user interface for the app using XML layouts.
This includes creating buttons for the game board, displaying the game status, and
adding options to restart the game or exit the app.

• Implementing the game logic: Implement the game logic using Java code. This includes
handling user input and determining the winner of the game.

• Testing the app: Test the app to ensure that it works as expected. This includes testing the
game logic, user interface design, and overall functionality of the app.

• Debugging and fixing issues: Debug any issues that are identified during testing and fix
them.

• Adding extra features: Once the basic game is working properly, consider adding extra
features to the app such as adding sound effects or allowing users to choose their own
symbols.

• Final testing: Test the app again to ensure that all features are working as expected.

• Deploying the app: Finally, deploy the app to the Google Play Store or other app stores
so that users can download and use the app.
4.Action plan:

Sr.no Details of activity Planned start date Planned end date Name of responsible group
members

1. Searching for the topic

2. Confirmed the topic we


searched for the micro
project

4. Collecting
information Akshata Revoor

5. Making proposal

6. Testing and analysis of test


result

7. Preparation of final
project report

8. Final submission of the


project
5.Resources Required:

Sr. No. Specification

Name of resources/Material

1. Computer system Intel i512th gen processor

2. RAM 4GB

3. Hard disk 1TB

4. Operating system Windows 11

6.Name Of Team Members:

Name Roll No.

Akshata Revoor 2116490083

Mrs.Sumoli Vaje
(Micro-project Guide)
Part B

1.Literature Review:

• "Development of Tic-Tac-Toe Game for Android Platform using Java Language" by G.


V. Rao etal. (2017): This study describes the development of a Tic-Tac-Toe game
application for Android platform using Java language. The authors utilized Android
Studio and Java to implement the game logic and user interface. They also conducted
user testing to evaluate the performance of the game and found that users were satisfied
with the game's performance.

• "Android Based Tic Tac Toe Game Application Development" by S. G. Bujade et al.
(2016): This study presents the development of a Tic-Tac-Toe game application for
Android platform using Java language. The authors utilized Android Studio to
implement the game logic and user interface. They also tested the application on
different Android devices and found that it was compatible with various devices.

• "Design and Implementation of Android-based Tic-Tac-Toe Game" by F. A. Hadi et al.


(2019):This study describes the development of a Tic-Tac-Toe game application for
Android platform using Java language. The authors utilized Android Studio and Java to
implement the game logic and user interface. They also conducted user testing to
evaluate the performance of the game and found that users were satisfied with the game's
performance.

• "Development of Tic Tac Toe Game for Android Platform Using Java Programming
Language" by R. Kumar et al. (2016): This study presents the development of a TicTac-
Toe game application for Android platform using Java language. The authors utilized
Android Studio to implement the game logic and user interface. They also tested the
application on different Android devices and found that it was compatible with various.
2.Code:

Main _Activity.xml:-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn5"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage5">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn4"
android:layout_toLeftOf="@id/btn5"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage4">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn6"
android:layout_toRightOf="@id/btn5"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage6">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="330dp"
android:layout_height="8dp"
android:background="@color/palmleaf"
android:layout_centerHorizontal="true"
android:layout_above="@id/btn5"
android:layout_marginBottom="8dp">

</RelativeLayout>

<RelativeLayout
android:layout_width="330dp"
android:layout_height="8dp"
android:background="@color/palmleaf"
android:layout_centerHorizontal="true"
android:layout_below="@id/btn5"
android:layout_marginTop="8dp">

</RelativeLayout>
<RelativeLayout
android:layout_width="8dp"
android:layout_height="350dp"
android:background="@color/palmleaf"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/btn5"
android:layout_marginRight="-14dp">

</RelativeLayout>

<RelativeLayout
android:layout_width="8dp"
android:layout_height="350dp"
android:background="@color/palmleaf"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/btn5"
android:layout_marginLeft="-14dp">

</RelativeLayout>

<Button
android:layout_width="320dp"
android:layout_height="50dp"
android:layout_below="@id/btn8"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:backgroundTint="@color/purple_200"
android:text="Reset"
android:id="@+id/reset"
android:textSize="15sp">

</Button>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn8"
android:layout_below="@id/btn5"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage8">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn7"
android:layout_below="@id/btn5"
android:layout_toLeftOf="@id/btn8"
android:layout_marginTop="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage7">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn9"
android:layout_below="@id/btn5"
android:layout_toRightOf="@id/btn8"
android:layout_marginTop="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage9">
</ImageView>

</RelativeLayout>

<LinearLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingRight="40dp"
android:paddingStart="40dp"
android:id="@+id/scoreboard"
android:layout_marginTop="40dp"
android:layout_centerHorizontal="true">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="Player 1:- 0"
android:textStyle="bold"
android:id="@+id/player1"
android:textColor="@color/papayawhip"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="Player 2:- 0"
android:textStyle="bold"
android:id="@+id/player2"
android:textColor="@color/papayawhip"/>

</LinearLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn2"
android:layout_above="@id/btn5"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage2">
</ImageView>

</RelativeLayout>
<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn1"
android:layout_above="@id/btn5"
android:layout_toLeftOf="@id/btn2"
android:layout_marginBottom="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage1">
</ImageView>

</RelativeLayout>

<RelativeLayout
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_centerInParent="true"
android:id="@+id/btn3"
android:layout_above="@id/btn5"
android:layout_toRightOf="@id/btn2"
android:layout_marginBottom="20dp"
android:background="@color/background">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/buttonimage3">
</ImageView>

</RelativeLayout>

MainActivity.Java:

package com.example.tictactoe;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {

ImageView button1,button2,button3,button4,button5,button6,button7,button8,button9;
private String startGame="X";
int b1=5,b2=5,b3=5,b4=5,b5=5,b6=5,b7=5,b8=5,b9=5,xCount=0,oCount=0,i=0;
private TextView scorex,scoreo;
private Button reset;
@Override
public void onBackPressed() {
finishAndRemoveTask();
this.finishAffinity();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

button1=findViewById(R.id.buttonimage1);
button2=findViewById(R.id.buttonimage2);
button3=findViewById(R.id.buttonimage3);
button4=findViewById(R.id.buttonimage4);
button5=findViewById(R.id.buttonimage5);
button6=findViewById(R.id.buttonimage6);
button7=findViewById(R.id.buttonimage7);
button8=findViewById(R.id.buttonimage8);
button9=findViewById(R.id.buttonimage9);
scorex=findViewById(R.id.player1);
scoreo=findViewById(R.id.player2);
reset=findViewById(R.id.reset);

reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
xCount=0;
oCount=0;

scorex.setText("Player 1:- "+String.valueOf(xCount));


scoreo.setText("Player 2:- "+String.valueOf(oCount));
resetVales();
}
});
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button1.setImageResource(R.drawable.ic_baseline_close_24);
b1=1;
i++;
}
else
{
button1.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b1=0;
i++;
}
choosePlayer();
winningGame();
}
});
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button2.setImageResource(R.drawable.ic_baseline_close_24);
b2=1;
i++;
}
else
{
button2.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b2=0;
i++;
}
choosePlayer();
winningGame();
}
});
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button3.setImageResource(R.drawable.ic_baseline_close_24);
b3=1;
i++;
}
else
{
button3.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b3=0;
i++;
}
choosePlayer();
winningGame();
}
});
button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button4.setImageResource(R.drawable.ic_baseline_close_24);
b4=1;
i++;
}
else
{
button4.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b4=0;
i++;
}
choosePlayer();
winningGame();
}
});
button5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button5.setImageResource(R.drawable.ic_baseline_close_24);
b5=1;
i++;
}
else
{
button5.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b5=0;
i++;
}
choosePlayer();
winningGame();
}
});
button6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button6.setImageResource(R.drawable.ic_baseline_close_24);
b6=1;
i++;
}
else
{
button6.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b6=0;
i++;
}
choosePlayer();
winningGame();
}
});
button7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button7.setImageResource(R.drawable.ic_baseline_close_24);
b7=1;
i++;
}
else
{
button7.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b7=0;
i++;
}
choosePlayer();
winningGame();
}
});
button8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button8.setImageResource(R.drawable.ic_baseline_close_24);
b8=1;
i++;
}
else
{
button8.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b8=0;
i++;
}
choosePlayer();
winningGame();
}
});
button9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(startGame.equals("X"))
{
button9.setImageResource(R.drawable.ic_baseline_close_24);
b9=1;
i++;
}
else
{
button9.setImageResource(R.drawable.ic_baseline_exposure_zero_24);
b9=0;
i++;
}
choosePlayer();
winningGame();
}
});
}
private void resetVales()
{

b1=5;
b2=5;
b3=5;
b4=5;
b5=5;
b6=5;
b7=5;
b8=5;
b9=5;
i=0;
}
private void choosePlayer(){
if(startGame.equals("X"))
{
startGame="O";
}
else
{
startGame="X";
}
}
private void winningGame(){

if((b1==1 )&& (b2==1) && (b3==1))


{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b4==1 )&& (b5==1) && (b6==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b7==1 )&& (b8==1) && (b9==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b1==1 )&& (b5==1) && (b9==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
if((b1==1 )&& (b4==1) && (b7==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
if((b2==1 )&& (b5==1) && (b8==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales()
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b3==1 )&& (b6==1) && (b9==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b3==1 )&& (b5==1) && (b7==1))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign X Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
xCount++;
scorex.setText("Player 1:- "+String.valueOf(xCount));
}
else if((b1==0 )&& (b2==0) && (b3==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b4==0 )&& (b5==0) && (b6==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b7==0 )&& (b8==0) && (b9==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b1==0 )&& (b4==0) && (b7==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b2==0 )&& (b5==0) && (b8==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b3==0 )&& (b6==0) && (b9==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setCancelable(false)
.setTitle("Congrats!!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b1==0 )&& (b5==0) && (b9==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}
else if((b3==0 )&& (b5==0) && (b7==0))
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("Sign O Wins")
.setTitle("Congrats!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();

}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
oCount++;
scoreo.setText("Player 2:- "+String.valueOf(oCount));
}

else
{
if(i==9)
{
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setMessage("No One Wins")
.setTitle("Opps!!")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
button1.setImageDrawable(null);
button2.setImageDrawable(null);
button3.setImageDrawable(null);
button4.setImageDrawable(null);
button5.setImageDrawable(null);
button6.setImageDrawable(null);
button7.setImageDrawable(null);
button8.setImageDrawable(null);
button9.setImageDrawable(null);
resetVales();
}
});
AlertDialog alertDialog=builder.create();
alertDialog.show();
}
}

}
OutPut:
4.Practical Outcomes:

Improved Programming Skills:

1. Developing an Android application using Java language in Android Studio can improve one's
programming skills. This project requires basic programming concepts, such as data types, loops,
arrays, and conditional statements.

2. Better Understanding of Android Development:


Developing an Android application for Tic-Tac-Toe game in Android Studio can provide a better
understanding of Android development. One can learn how to create a user interface, handle user input,
and store and retrieve data in Android devices.3.

3. Enhanced Problem-Solving Abilities:


Creating an Android application for Tic-Tac-Toe game requires solving problems like how to
implement the game logic and designing the user interface. Such challenges can improve one's
problem-solving abilities.4.

4. Marketable Skill:
Developing an Android application for Tic-Tac-Toe game can make one more marketable. Android
development is a highly in-demand skill, and having an application in the portfolio can make one stand
out in the job market.5.

5. Fun and Entertaining:


Lastly, developing an Android application for Tic-Tac-Toe game can be a fun and entertaining project.
One can enjoy the process of creating something from scratch and may even use it as a way to pass the
time with friends and family.

5.Application of this Micro-Project:

1. Learning Tool:
This project can be used as a learning tool for students or individuals who are new to Android
development or Java programming. It can help them understand the basics of Android app development,
user interface design, and game logic implementation.

2. Entertainment:
The Tic-Tac-Toe game is a popular game and can be an entertaining application for users. Users can play
the game against the computer or against another player. It can be a fun way to pass the time and improve
their critical thinking skills
3. Portfolio Piece:
The project can be added to the developer's portfolio to showcase their skills and experience in Android
app development. This can help them stand out in the job market and increase their chances of getting
hired for a relevant position.

4. Educational Tool:
The project can be modified to include more advanced game logic or additional features to make it a more
educational tool. For example, it can be modified to teach children about mathematics or programming
concepts.

5. Open-Source Project:
The project can be shared as an open-source project on platforms like GitHub, where other developers can
learn from it or contribute to it by adding new features or fixing issues. This can help create a community
of developers who are passionate about Android app development and can collaborate on future projects.

6.Conclusion:
In conclusion, the development of the Android Tic Tac Toe application has successfully provided users with an
enjoyable gaming experience. Through strategic planning, efficient coding practices, and user-friendly design,
the application offers a seamless interface for players to engage in the classic game. With its intuitive controls
and customizable features, the app caters to a wide audience, making it a fun and accessible option for all ages.
Overall, the project demonstrates the potential of mobile application development in delivering entertaining
and engaging experiences to users.

Mrs.Sumoli Vaje
(Micro-Project Guide)

You might also like