Android
Checked against c1b2fa4 on 2026-11-10. The files it covers are unchanged since.
The Android host draws the render stream with Jetpack Compose and Material 3
and calls the core over JNI (crates/niso-android, built as
libniso_android.so). It comes in two parts:
hosts/android/niso, an Android library: the engine (Engine.kt), the renderer (NodeView.kt,RenderNode.kt), native controls (Controls.kt), the theme the page sees (Theme.kt) and media (MediaHost.kt). Apps build on it.hosts/android/app, the host app: an activity running one page, plus its home screen widget and notifications.
Build and run
Section titled “Build and run”hosts/android/build.sh # examples/counter on a running emulator or devicehosts/android/build.sh timer # another examplehosts/android/build.sh --app LIB # a native app library (arm64, exports niso_app_main)hosts/android/build.sh --jvm DIR CLASS # a Java or Kotlin app on the dev.niso.dom bindingWith no device attached, the script starts the AVD named in NISO_AVD.
NISO_APK_LABEL builds a standalone APK instead (hosts/android/apk.sh), and
NISO_ENGINE=porffor compiles the page’s script ahead of time with Porffor
(Engines). Setup is in Android apps.
What a page gets
Section titled “What a page gets”The host runs the page’s event loop on every display frame while it animates
(niso_dom_needs_frame), and otherwise only when the user acts, a timer is
due, or a worker or native module sends something, so an idle page costs
nothing. Pages can import native modules written in Kotlin as
niso:<name> (Native modules).
- Home screen widget: a Glance widget draws the page’s
widget.smallorwidget.mediumtemplate, whichever fits (SurfaceWidget.kt). - Ongoing notification: while the page has an activity surface, it’s an
ongoing notification (Android 16 promotes it to a Live Update). The
template maps onto the notification’s fixed slots: first text as the
title, a timer as its chronometer, a progress bar, buttons as actions
(
Surfaces.kt). - Media: the page’s media session keeps playing in the background with
the system’s media notification (
MediaHost.kt).
Wear OS, Android TV and Android Auto are planned, not built (Planned platforms).