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.
Requirements
Section titled “Requirements”| 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.
Build and install
Section titled “Build and install”-
Build the APK and run the tests.
Terminal window cd android./gradlew assembleDebug testDebugUnitTestThe APK is
app/build/outputs/apk/debug/app-debug.apk. -
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.comYou can also tap Portal on the sign-in screen and enter the address. Plain HTTP works only for
localhost,10.0.2.2and127.0.0.1. -
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
localhoston the device is your computer:Terminal window adb install -r app/build/outputs/apk/debug/app-debug.apkadb reverse tcp:8000 tcp:8000adb reverse tcp:5173 tcp:5173 -
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.
Build in an Amp orb
Section titled “Build in an Amp orb”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.
