Version 1.4.0 (current)
Develop a native Java APK on the device
Compile, sign, install and update a native score app in the prepared experimental environment.
This experimental path lets the Agent write Java and a Manifest on Android, then compile an actual native APK. The UI uses Android Views, without React, WebView or a precompiled business shell. For web-based application logic use the React/WebView tutorial.
Environment and prerequisites
Verified on a dedicated Android 16 / API 36 / ARM64 emulator: creation, on-device compilation/signing/installation, volume API checks, persistence, data retention across a same-signature update, shared Provider/UI state and permission rejection. This path is not yet verified on physical devices or the latest complete system. Its toolchain is a separately provisioned experimental environment and does not ship with the system.
The environment maintainer must prepare ECJ, D8, Android SDK stubs, aapt2/aapt, zipalign, apksigner and a dedicated development signature, and deploy source tooling/app-kit/build-native.sh to /data/local/agentos/light-app-lab/build-native.sh. This guide does not provide a cross-device dependency installer or distribute keys or APKs.
Requires the system source
tooling/app-kit/build-native.sh comes from the taku-os system source. Clone taku-os first.
Confirm the target and assistant/Codex versions with Environment checks. The independent display must be ready. Read its current display ID. Do not hardcode it, and do not operate main display 0.
Develop and verify
Request a specific app
Use a new experimental directory and package to avoid overwriting an existing app. Adapt these example identifiers for your environment:
Create a native Java score app inside this prepared Android development device.
Project: /data/local/agentos/light-app-lab/generated/my-native-score
Package: org.taku.example.nativescore; MainActivity: .MainActivity
Write src/org/taku/example/nativescore/MainActivity.java and AndroidManifest.xml.
Use native Views, version 1 / 1.0, minSdk 30, targetSdk 35.
A/B each have an increment button, with undo and SharedPreferences persistence.
Show actual Android API, app UID, battery and sensor count; never hard-code them.
If adding a media-volume experiment, request only MODIFY_AUDIO_SETTINGS and add restore.
Check the existing toolchain and current independent background display ID first.
Build with the on-device build-native.sh and operate only the designated display.
Keep build logs, report failures accurately, and leave other apps alone.This request creates files and installs an app. The optional volume experiment changes media volume and must restore the original value. Confirm the directory, package and display belong to this development experiment.
Build and install on Android
The Agent or developer runs this in the prepared device shell. Replace the placeholder with the actual background display ID; the script checks that it exists.
TAKU_APP_DISPLAY=<BACKGROUND_DISPLAY_ID> sh /data/local/agentos/light-app-lab/build-native.sh /data/local/agentos/light-app-lab/generated/my-native-scoreThe script compiles Java, converts DEX, packages, aligns, signs, verifies the signature, runs pm install -r, and launches on that display. The project output is build/app.apk, followed by its file hash. On failure, inspect the first actual tool error and fix the source or prerequisites. An APK file alone does not prove successful installation or launch.
Check the package, UI and persistence
In the same device shell run:
pm path org.taku.example.nativescore
dumpsys package org.taku.example.nativescoreCheck the actual path, version and app UID, then view the app on the designated background display. Record initial scores, increment and undo, reopen the app, and verify persisted state. System values must come from actual APIs. For the volume experiment, read the original level, change one step, restore and read back. Emulator sensor counts do not establish physical hardware support.
Update and verify retained data
Ask the Agent to retain the package, signature and storage, raise versionCode=2 / versionName=1.1, and rerun the on-device build script. pm install -r should replace the existing package. Do not uninstall to bypass a signature error. Verify both the new version and the previous scores/history.
For an advanced experiment add a ContentProvider guarded by android.permission.DUMP. Let query, score.add, score.undo and the Activity use one state implementation. Check nonzero-parameter validation, unchanged data after errors, unauthorized-call rejection and UI refresh through ContentObserver. This is a native app interface, not another HTTP server.
Record results and resolve failures
Record source revision, actual device version, app version, signature consistency, build logs, APK hash and background-display screenshots. Build time and APK size describe this example rather than arbitrary Android projects.
Missing tools require completing environment provisioning. Signature mismatches require checking the installed package and dedicated development key. For Provider failures inspect Android permissions and actual error text, not just the content command exit code. See Update and recovery for version boundaries.
Continue to App interfaces and shared state and record emulator and physical-device results separately using the contribution guide.
Research preview · Current availability
Report an issue or give feedback
Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.
Built with Fumadocs