/bomb-client-app

💣📡📱 Exit Game Client App - Remote control the ExitGame bomb

Primary LanguageKotlin

💣📡📱 ExitGame Bomb - Android Client App

Kotlin Kotlin-Coroutines LibGDX

This app is part of an ExitGame where payers have to deactivate a bomb by coding challenges. The client app can configure the bomb remotely.

The Bomb runs on an android device. It starts with a countdown before it explodes. It's not accessible for the players. Players have to deactivate the bomb with coding challenges. The deactivation commands are sent to an REST interface of the bomb app.

🚀 Start

The App runs on Android and Desktop. So you can run, test and develop it without an Android device or emulator. To start the app run the Gradle task:

  • Run Desktop: desktop > Tasks > other > run
  • Run Android: android > Tasks > other > run
  • Build Android: android > Tasks > build > build

You can also run the DesktopLauncher class direct and skip the gradle build - which can be faster. Then you have to set the Working directory of the Run Configuration to ${your-path}\bomb-app\android\assets.

After an android build, the apps apks are present in bomb-app\android\build\outputs\apk\debug and ...\release. You can install them with:
adb install -r "${full-path}\bomb-app\android\build\outputs\apk\debug\android-debug.apk"

Run Gradle tasks with at least Gradle 5.5 and ensure it runs with a Java 1.8 JDK. You can check this here:
IntelliJ > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM

💡 External Hardware

💡 The comb can be paired with external Hardware. It connects to a Phillips Hue bridge and controls lights. So lights switch to RED if the bomb gets activated and to GREEN if it gets disarmed. See HueService or yetanotherhueapi for details.

🔊 To bomb also plays audio files, so it may be a good idea to connect it with an external Bluetooth speaker.

⏰ The bomb can connect to an external Arduino hardware based 7-segment countdown timer.
This optional project is available here: Arduino-Countdown-Timer. See TimerService for interface details.

🔧 Config

The settings screen allows you to change the bombs configuration.

Setting Description
Bomb time * The time before the bomb explodes in minutes.
Timer IP IP Address of the external timer.
Hue IP IP Address of Phillips Hue bridge.
Hue Room Name of the room with the Hue Lights. Change it in the Phillips Hue App.
Hue Key API Key from a paired HUE. Pair the Hue to retrieve it.
Debug If selected, you can switch the screens by Space or touch.
* The Bomb time can be also changed by the REST interface.
Button Description
Reset Hue Clear the Hue API key, so you have to pair the Hue again.
Pair Pair the bomb with the Phillips Hue bridge. Creates a new API key.
Start Start the bomb in inactive mode.

🐞 Troubleshooting

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: 
Couldn't load file: icons/icon_16.png

You forgot to to set the Working directory of the Run Configuration to ${your-path}\bomb-app\android\assets.


Could not resolve all files for configuration ':core:compileClasspath'.
   > Could not find io.github.tobsef:yetanotherhueapi:1.3.0.

You need the yetanotherhueapi maven dependency. For now it may be not present int the maven central. So check it out and manual install it with:
git clone https://github.com/TobseF/yetanotherhueapi.git
mvn install -DskipTests


android:mergeDexDebug FAILED
DexArchiveMergerException: Error while merging dex archives
Program type already present: com.libktx.game.AndroidLauncher

Run a android > Tasks > build > clean with gradle, and try it again.


Error running 'Run Desktop': Class 'com.libktx.game.desktop.DesktopLauncher' not found in module 'desktop'

Just launch it again.


Exception in thread "main" java.lang.UnsupportedClassVersionError: com/intellij/junit5/JUnit5IdeaTestRunner : 
Unsupported major.minor version 52.0

Ensure you run unit tests with an Java 1.8 JDK.