/cryptogram-game-android

Primary LanguageJavaApache License 2.0Apache-2.0

cryptogram-game-android

This was a project developed for the following class where software architecture and testing of Java and Android were covered, and this was the final project.

See the "architecture-and-testing-plans" folder root folder for architecture/testing documents used to plan this project.

Additionally, see below for instructions on how to run the Android game and the user manual on how to use it.

How to launch Android app:

  1. run Android Virtual Device in Android Studio
  2. drag and drop the .apk file in the root directory onto the simulator screen
  3. look for the app Crypto6300 in the listing of all apps

How to export .apk file after making any changes:

  1. run command From menu Build-> Build Bundles/APKs->Build APK
  2. You will find APK file in folder app/build/outputs/apk/debug

Cryptogram Game User Manual

1. Description

Cryptogram is a game where a common word or phrase is encrypted and the player wins a game by decoding the encrypted phrase.

2. How to for Admin

2.1 Log In

  • Launch the app and enter the admin username "CryptoAdmin".

  • Click "LOG IN" button to log in and navigate to the admin home screen.

  • There are three options:

    • View all the players' game statistics.
    • Add a new player into the game.
    • Add a new cryptogram game.

    Click one button to navigate to the corresponding screen.

2.2 Player Statistics

  • Click "PLAYER STATISTICS" on the admin home screen to view the table of player statistics. This table displays all the players' first name, number of won, number of lost, username and difficulty category in descending order of number of cryptograms won.

  • Click "BACK" button on the navigation bar to navigate back to the admin home screen.

2.2 Add a New Player

  • Click "ADD A NEW PLAYER" on the admin home screen to navigate to the form for new player creation.

  • Fill the new player information: first name, last name, username and difficulty category.

  • Must provide a non-empty text for each input, otherwise error messages will display. Easy difficulty category is selected by default for a new player.

  • If an username is already used by an existing player, an error message will display. Must provide an unique username for the new player.

  • After confirming all the entered information is valid, click "SAVE" to create the new player. A dialog with a confirmation message will show up indicating the success of adding a new player.

  • Click "OK" to close the confirmation dialog. All the inputs are reset for adding another new player.

  • Click "BACK" button on the navigation bar to navigate back to the admin home screen.

2.2 Add a New Cryptogram

  • Click "ADD A NEW CRYPTOGRAM" on the admin home screen to navigate to the form for new cryptogram creation.

  • Fill the new cryptogram information: name, answer and tries allowed per difficulty.

  • Tries per difficulty must satisfy the following: Easy > Normal > Hard

  • Must provide a non-empty text for each input, otherwise error messages will display.

  • If a cryptogram name already exists, an error message will display. Must provide an unique name for the new cryptogram.

  • After confirming all the entered information is valid, click "SAVE" to create the new cryptogram. A dialog with a confirmation message will show up indication the success of adding a new cryptogram.

  • Click "OK" to close the confirmation dialog. All the inputs are reset for adding another new cryptogram.

  • Click "BACK" button on the navigation bar to navigate back to the admin home screen.

3. How to for Player

3.1 Log In

  • Launch the app and enter the player username, e.g. "player1".

  • An error message will display if the player doesn't exist.

  • Click "LOG IN" button to log in and navigate to the player home screen.

  • There are two options:

    • View all the unsolved cryptograms.
    • View all the players' game statistics.

    Click one button to navigate to the corresponding screen.

3.2 Unsolved Cryptogram List

  • Click "CRYPTOGRAM TO SOLVE" on the player home screen to view the list of unsolved cryptograms.

  • The cryptograms with "UNSTARTED" are the ones that the player has not started.

  • The cryptograms with "INPROGRESS" are the ones that the player has started but has not won or lost.

  • The cryptograms that have been completed (either won or lost) are not shown on this list.

3.3 Solve a Cryptogram

  • Click any "UNSTARTED" or "INPROGRESS" cryptogram to open the screen for solving the cryptogram.

  • If the cryptogram has been started before and is in progress, the previous answer entered by the player will display. Otherwise, the answer input will be empty.

  • The word or phrase is encrypted randomly using an one-to-one substitution cipher. e.g. All the letter "u"s in the encrypted phrase stand for all the letter "a"s in the answer.

  • Click "SAVE AND QUIT" to temporarily save the answer without submitting it and navigate back to the unsolved cryptogram list. The player can reopen this cryptogram later to continue working on it.

  • There is an "Attempts Left" for each cryptogram for each player. It is originally the same as the tries allowed per difficulty when the cryptogram is created. e.g Attempts Left is 10 for the cryptogram "Something to eat 4 when the player opens it and has not made any attempt submissions.

  • Click "SUBMIT" to submit the answer and check if the submitted answer is correct. If the answer is wrong, a dialog with a message shows up.

  • Click "OK" to try again if there are still attempts left. The attempts left decreases by 1 whenever a wrong answer is submitted.

  • If a correct answer is submitted, a dialog with "You Won" message shows up.

  • If a wrong answer is submitted and no more attempts left, a dialog with "You Lost" message shows up.

  • Click "OK" to navigate back to the unsolved cryptogram list to choose another cryptogram.

3.4 Player Statistics

  • Click "PLAYER STATISTICS" on the player home screen to view the table of player statistics. This table displays all the players' first name, number of won, number of lost in descending order of number of cryptograms won.

  • Click "BACK" button on the navigation bar to navigate back to the admin home screen.