Conversation
Same webview_* Ring C-API as desktop, backed by android.webkit.WebView over JNI. Package io.github.ysdragon.webview. UI thread owns the WebView and only enqueues; worker thread owns the Ring VM and runs the job queue. g_on* names are worker-only; JNI enqueues raw events. Flags are C11 atomics; queue bounded at 4096. Rotation re-attaches and re-pushes shim+scripts; renderer crash rebuilds the view and reloads. Single instance per process.
Adds CMake target for ring_webview_android when building for Android, linking against android, log, and yyjson libraries.
Notes app with glassmorphism mobile UI: add/edit/pin/delete/search, file-backed persistence, bridge driven by native onDomReady. Includes ring2apk config, Java/C sources, README, and screenshot.
Update README to include Android in cross-platform features list, add collapsible Android setup section, and document Nota example app.
ysdragon
added a commit
that referenced
this pull request
Sep 5, 2026
Android WebView backend + Nota example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
I ported the same
webview_*Ring C-API to Android, backed byandroid.webkit.WebViewthrough JNI — onemain.ringruns on desktop andAndroid via ring2apk. Package
io.github.ysdragon.webview.src/c_src/ring_webview_android.c+src/android/…/MainActivity.java+proguard-webview.pro. Desktop andAndroid builds are mutually exclusive in CMake.
owns the Ring VM behind a bounded (4096) condvar-gated queue. JNI
enqueues raw events,
g_on*callbacks are worker-only, lifecycle flagsare C11 atomics. Stale
wreturns drop instead of crashing.rebuilds the view and reloads the last HTML/URL — poison pages stop after
3 crashes in 10s. Single instance per process.
examples/android/— add/edit/pin/delete/search, file persistence, glassmorphism UI, bridge driven by native
onDomReady(no polling).ring2apk 1.1.0dependency, example + backend inpackage.ring, version bumped to 1.6.0 with a1.5.2versions entry,docs/ANDROID.mdstarter guide, Android sections + device screenshot inthe READMEs.
Nothing here breaks the API — it's additive over
dev. The 1.6.0 numbercomes from the yyjson bridge break already in
dev, not from this branch.Tested (device, arm64)
examples/android/ring/fulltest.ring— 20/0, zero JS console errors.files/notes.db); rotation keeps state;idle-kill restores content.
-Wall -Werrorclean,javacclean, Java mirrors in sync.