Skip to content

Developer Guide Android

Quantumrunner edited this page May 16, 2021 · 2 revisions

Development Environment

Android SDK

  1. To develop apps, you need the Android SDK, so install and update Android Studio.
  2. Press Windows + R and type in control sysdm.cpl and press Enter.
    1. Goto Advanced → Environment Variables.
    2. Under the System Variables add an entry named ANDROID_SDK_ROOT with the value %LOCALAPPDATA%\Android\sdk.
    3. Modify the System Variable named PATH and add the path %ANDROID_SDK_ROOT%\platform-tools and %ANDROID_SDK_ROOT%\tools (remember to separate the paths with a semicolon ";" on Windows 7 or below. Windows 10 will show you a list, no manual separation needed).
  3. Press Windows + R type in cmd and press Enter. Type in adb version and press Enter. The command should succeed and display the ADB version.
  4. Activate the Developer Options on your Android device by entering Settings → About Device → Build number → Tap it 10 times. You will then find a new entry Settings → Developer Options on your device. Inside activate Android (USB) Debugging.
  5. Connect your device to your computer via USB.
  6. Press Windows + R type in cmd and press Enter. Type in adb devices and press Enter. You should see your device listed in the returned command result.
  7. Open Unity and load the Valkyrie project. Goto File → Build Settings, select "Android", press "Switch Platform" and press "Build and Run". A popup may appear on your Android device (depending on the Android version), asking for permission to push apps from your PC via ADB. Allow it.
  8. To see your console debug output press Windows + R.
    1. Type in cmd and press Enter. Type in monitor and press Enter.
    2. Look at the logcat tab for the logs.
    3. You may add a filter for the Application Name com.bruce.valkyrie to only see the debug messages of the valkyrie app.
    4. You can add a log output by using ValkyrieDebug.Log("Hallo World"); inside the source.
  9. If you have no Android device or you want to test on different Android versions, you can use Android Studio to setup an emulator.

Release

To build a release APK it should be signed. This is done automatically using the build.bat in the projects root dir. The process involves jarsigner.exe, which will use the user.keystore (keystore password: valkyrie, keypair password: valkyrie) from the JDK and the zipalign.exe from the Android build tools.

Screenshots

Screenshots can be made by holding Vol- + Power. Some devices need Home + Power for it to work.

Clone this wiki locally