Skip to content

Get started for Android

Installation

  1. Install the JetBrains Toolbox (free): this will allow to easily install and manage IntelliJ and Android Studio versions and updates.
  2. In the JetBrains Toolbox, install Android Studio (free).
  3. Start Android Studio.
  4. In the Setup Wizard:
    • Install Type: Standard
    • License Agreement: Accept the terms and conditions for the different components
    • Press finish and wait for the download to finish
  5. On the welcome screen, select "Clone repository":
    • URL: https://gitlab.com/bordeauxkt/kotlin-15.git
    • Directory: Choose where you want to store the project
  6. When prompted, select "Trust project".
  7. If prompted, enable "Parallel sync for this project".

You may need to wait for some time before all the dependencies are downloaded and Android Studio finishes loading the entire project.

Project structure

core contains the game rules:

  • Card, Color, Deck and Player are the essential data structures
  • The game folder contains the different game states.

shared contains most of the UI code:

  • game contains state handling.
  • settings contains the configuration (e.g., light and dark theme).
  • ui contains the UI components.

app contains the configuration for the Android application itself. It contains very little code.

Run on an emulator

Android applications can be run inside the Android Studio Emulator even if you don't have an Android phone or tablet.

  1. Open the Device Manager (should be one of the icons on the right side of the screen). If the Device Manager is not visible on screen, click on the three-dot button on the left side of the screen.
  2. Click the "+" button, then "Create virtual device".
  3. Select the model you want to install, for example, "Pixel 10", then select "Next", then "Finish".
  4. Once the download is over, the device should be listed in Device Manager. Click its gray arrow to start it.
  5. Once it's started, you can select it on the top-right in "No Devices" (or where another device is listed).
  6. Click the green arrow .
  7. The first build can take more than a minute.

The app should open on the right side of the screen.

When you're done, use the shutdown button to stop the emulator.

Run on a real device

  1. In the top-right, click on "No Devices" (or where another device is listed).
  2. Select "Pair device using Wi-Fi".
  3. Verify that your phone and your computer are in the same Wi-Fi network.
  4. On your phone, enable Developer Options.
  5. In Developer Options, enable Wireless debugging.
  6. Your phone should now appear in Android Studio. Select "Pair".
  7. Follow the on-screen prompts.
  8. If pairing was successful, you should now see the name of your phone on the top-right.
  9. Click the green arrow .
  10. The first build can take more than a minute.

The app should open on your device.