Giter VIP home page Giter VIP logo

others_project003's Introduction

Other Project 003

A simple Tic Tac Toe application for Android devices. This repo purpose is for learning and practice only.

๐Ÿ˜„ Getting Started/Brief Description

This is a game of Tic Tac Toe with a 3*3 playing field. Player 1 go first.
If anyone got 3 markers in a row, column or 2 cross lines, that player wins. A draw can happen.
Press the RESET button to erase all data of the game (player's score, the state of the button X/O, ...)
All data are kept when orientation changed (e.g portrait -> landscape)

๐Ÿ’ป Prerequisites/Built With/Technologies used

  • Android Studio version 3.5
  • Java

๐Ÿ“„ Installing/Running

  • clone this repo
  • run it using Android Studio

๐Ÿš— Deployment

This was intentionally left blank.

๐Ÿ“ Notes

All buttons are named like this: button_xy to access it ez when calling it from a loop.

What is View

  • View is like elements in HTML where components like buttons, text inputs are view

What does this line mean buttons[i][j].setOnClickListener(this);

  • calling the class itself (here is MainActivity)
  • we saw MainActivity implements View.OnClickListener -> this class now has a met called onClick(View v){}
  • -> we write logic code inside that new override method inherited from super class

How to save data when change orientation

  • in activity_main.xml, have this line android:freezesText="true" in each element that wanna keep the text unchanged
  • save data using this func protected void onSaveInstanceState(Bundle outState){ // code in here}
  • take data using this func protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState){ // code in here}
    • use appropriate mets for data type (e.g putInt and getInt; putBoolean and getBoolean)

๐Ÿ”” Contributing

This was intentionally left blank.

๐Ÿ’ฌ Authors

Check Credits

โ• License

This was intentionally left blank.

๐Ÿ“ง Credits/Acknowledgments/References

This exercise was done using this tutorial

others_project003's People

Contributors

phquang98 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.