The Android app: the same egui window as the desktop, in an APK for 64-bit ARM phones and tablets with Android 8 (API 26) or later.
- No Java code. The APK's activity is Android's own
android.app.NativeActivity(AndroidManifest.xml). It loadslibnotecraft_android.so, built from this crate, and calls itsandroid_main(src/activity.rs). - The window is eframe's native-activity backend drawing with wgpu (Vulkan, or OpenGL ES 3).
It runs
NoteCraftAppfromcrates/ui-egui, unchanged. Narrower than 600 points the window uses the phone layout (crates/ui-egui/src/compact.rs). - Storage (
src/storage.rs): settings and logs in the app's internal storage; notebooks inAndroid/data/com.alientechsoftware.notecraft/files/NoteCraft, which can be copied off the device over USB. - The Welcome notebook (
src/welcome.rs): both editions travel in one APK asset, are unpacked into internal storage once per version, and the first-use wizard copies the chosen edition into the notebooks folder, as on the desktop. - Back closes a dialog, the File screen, the Tags Summary or the page templates, then turns a full-window page back into the notebooks list.
- The soft keyboard opens while a block of the page has the caret, and for text boxes.
- Unsafe code: one attribute. Android finds
android_mainby its unmangled name, and#[unsafe(no_mangle)]counts as unsafe code. The crate denies unsafe code and allows it on that one function (Cargo.tomlsays why).
What is missing (file pickers, the system clipboard, folders outside the app's storage, composing
input, the screen reader) is listed under Android in docs/gaps.md.
Set up once with SKILLS/nc-devx/scripts/setup.android.sh
(Linux or WSL2), then from the repository root:
bash android/build.sh # dist/android/notecraft-<version>-android-arm64.apk
bash android/test.sh # checks the APKbuild.sh signs with the key in ANDROID_KEYSTORE when it is set, and otherwise with a key made
for that build only (see docs/releasing.md, Android signing).
ci-setup.sh prepares a GitHub runner; the CI workflow runs clippy for the arm64
target and the Packaging workflow builds, checks and uploads the APK, which the nightly release
publishes.
adb install -r dist/android/notecraft-<version>-android-arm64.apk
adb shell am start -n com.alientechsoftware.notecraft/android.app.NativeActivity
adb logcat -s NoteCraftMore in SKILLS/nc-devx/references/android.md.