Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 3.51 KB

File metadata and controls

103 lines (79 loc) · 3.51 KB

Android Support

Android uses the embedded runtime backend route and is currently runtime_partial. wzzc-dev/window/android owns the Android lifecycle, surface, and input queue; moui/backend/android converts those callbacks into the MoUI runtime session and moui/backend/android/skia provides presentation.

Entry Points

Piece Location
App logic examples/<app>/app
Mobile metadata examples/<app>/moui.mobile.json
MoonBit entrypoint examples/<app>/android_window_hosted
Android host template wzzc-dev/window/android/template
MoUI embedded runtime backend moui/backend/android/window_hosted.mbt

The entrypoint constructs AndroidEmbeddedRuntimeBackend and runs it through window/android::EventLoop. Do not add another lifecycle, surface, or input bridge beside the window event loop.

Toolchain

  • JDK 17 or newer (JDK 21 recommended)
  • Android SDK compile API 36 and target API 35
  • NDK 28.2.13676358 and CMake 3.22.1
  • Gradle 9.6.1 or compatible wrapper
  • Application minimum SDK 23

SDK, NDK, And Emulator Setup

Use a full JDK installation. Set the SDK root to the location chosen on the local machine; the repository does not require a machine-specific path.

export JAVA_HOME=/path/to/full-jdk
export PATH="$JAVA_HOME/bin:$PATH"
export ANDROID_HOME="${ANDROID_HOME:-$HOME/Library/Android/sdk}"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH="$ANDROID_HOME/platform-tools:$PATH"

scripts/setup-android-sdk.sh --accept-licenses --ndk 28.2.13676358
eval "$(scripts/setup-android-sdk.sh --print-env)"
export ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$ANDROID_HOME/ndk/28.2.13676358}"
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"

The helper installs platform tools, API 36, Build-Tools 35.0.0, CMake 3.22.1, and the pinned NDK. It does not install an emulator image. On Apple Silicon use an arm64-v8a image; on x86_64 hosts use the matching x86_64 image.

sdkmanager --install \
  "emulator" \
  "system-images;android-34;google_apis;arm64-v8a"
echo no | avdmanager create avd \
  -n moui_api34 \
  -k "system-images;android-34;google_apis;arm64-v8a" \
  -d pixel_6 \
  --force

emulator -avd moui_api34 -gpu host -no-snapshot-save &
adb wait-for-device
adb shell getprop sys.boot_completed

Run moui doctor --platform android before a native build.

Build And Run

From the repository root:

moon check examples/showcase/android_window_hosted --target native
moui build android showcase \
  --mobile-config "$PWD/examples/showcase/moui.mobile.json"
moui run android showcase \
  --mobile-config "$PWD/examples/showcase/moui.mobile.json"

Use --prepare-only to inspect generated native inputs without invoking Gradle. --fallback-skia verifies packaging only; it does not establish renderer or runtime support.

Validation And Evidence

Host-sim validation does not require an emulator:

sh scripts/window-hosted-hostsim-smoke.sh
moon test moui/backend/android --target native

For a runtime claim, use a matching device or emulator and record first frame, input, surface detach/recreate, IME, clipboard, accessibility, and async-image observations. Keep checks/platforms/android.json at partial until that evidence verifies the actual presenter route.

Status

The route is usable for development and template integration, but it is not a product-complete Android claim. See docs/platform-readiness-declaration.md and docs/window-hosted-moui.md for the evidence boundary.