Skip to content

Android app

android/ is a native Kotlin and Jetpack Compose app, built to match the iPhone app in ios/. It calls the portal’s /api routes, the same as the web app, and keeps no credentials of its own. See Android app for how it works.

Tool Version
JDK 17
Android SDK Platform 37 and build tools. Android Studio installs them.
A device or emulator Android 8.0 (API 26) or later
A running portal Deployed, or local from Local setup

Point Gradle at the SDK with ANDROID_HOME, or with sdk.dir in android/local.properties.

  1. Build the APK and run the tests.

    Terminal window
    cd android
    ./gradlew assembleDebug testDebugUnitTest

    The APK is app/build/outputs/apk/debug/app-debug.apk.

  2. Choose the portal. By default the app opens http://localhost:8000, the local API from Local setup. For another portal, build with its address:

    Terminal window
    ./gradlew assembleDebug -PportalUrl=https://factory.example.com

    You can also tap Portal on the sign-in screen and enter the address. Plain HTTP works only for localhost, 10.0.2.2 and 127.0.0.1.

  3. Install the app on a running emulator or a device with USB debugging. For a local portal, also forward the API and web ports, so that localhost on the device is your computer:

    Terminal window
    adb install -r app/build/outputs/apk/debug/app-debug.apk
    adb reverse tcp:8000 tcp:8000
    adb reverse tcp:5173 tcp:5173
  4. Tap Sign in with GitHub. A browser tab opens GitHub. After you sign in, the browser returns you to the app, which is signed in.

No portal setting changes for the app. The GitHub OAuth App and GitHub App keep their web callback and setup URLs, and the portal’s APP_BASE_URL stays the web address.

Orbs have no KVM, so they cannot run the Android emulator. The build and unit tests do run in an orb. android/gradle.properties is sized for an orb with 4 GB of memory: one worker, and the Kotlin compiler runs inside the Gradle daemon.