Repository navigation
feat(app): tablet shares to the Mac; APK updates in place; update prompt; full screen; responsive + dark mode - #24
Conversation
"Share this screen" in the Android app makes the tablet a Mirror-only
Mullion host. A Mac shows it with Connect to Another Computer… (or any
browser), and pairs with the 6-digit code the tablet shows, as with a Mac.
- Capture (crates/app/android/kotlin): MainActivity asks Android for consent.
ShareService, a foreground service of type mediaProjection with a
"Stop sharing" notification, feeds a virtual display into the hardware
H.264 encoder: Baseline, 30 fps, 6 Mbps, long side at most 1920, repeating
the last frame after 100 ms so a still screen keeps streaming. Each output
buffer goes to Rust over JNI. Its return value asks for a key frame, so
Rust never calls back into Java.
- Host (crates/app/src/share.rs): an AndroidPlatform for mullion_host.
- MediaCodec's SPS/PPS go in front of every IDR (unit tests).
- The host starts on the first share, on port 47100 with Extend off and its
pairing store in the app's files.
- Between shares it refuses to stream.
- Pairing codes and share state go to the page over the bridge.
- Page: a Share button and a sheet with the address, the viewer count, the
pairing code with "Don't Allow", and Stop sharing. Android holds Rust's
events while it has paused the app, so the page pokes the bridge while
waiting and on coming back.
- Signaling's /hello says "Android". pair.js names the host instead of "the
Mac", since a Mac now pairs with tablets too.
- build-android.sh puts the Kotlin over dx's output and adds the service and
its permissions to the manifest. A rerun no longer fails on dx's template
icons sitting next to ours.
Checked: 74 tests pass. In an Android 15 emulator: consent, the service and
its notification; /hello; pairing; offer, ICE, DTLS and the data channel; a
receiver decodes 1072x1920 frames; Stop sharing ends the service.
…t one Updating the Android app failed with "package conflicts" and had to be uninstalled first. Gradle signs debug builds with ~/.android/debug.keystore, and a fresh CI runner makes a new one each time, so every beta APK had its own key and Android refuses an update signed with another. The release workflow now writes one key, the ANDROID_DEBUG_KEYSTORE secret, there before building. Without the secret (a fork's PR) the build warns and goes on as before. The update link no longer says to remove the app first. The APKs already installed were signed with the old one-off keys: the next install needs that last uninstall, and later ones update in place.
EvidenceI captured this in an Android 15 emulator (arm64) on the Mac. The files are in The tablet sharing, after Android's consent. The status bar shows Android's cast icon. The foreground-service notification, which Android requires for screen capture: The tablet's host ( The receiver was the app's own page, over loopback. The Mac can't reach the emulator's UDP ports, so a Mac viewing a real tablet still needs a test on real devices. |
- Update: the apps showed a newer version only as a small link at the bottom,
and on Android the link could not open (the web view ignores a new window
and cannot install a download). A newer version is now asked about once per
start ("Mullion X is out. You have Y." Later / Update). Update, the link,
GitHub and Sponsor open in the system browser through mullionNative.open
(https only, the webbrowser crate dioxus already uses).
- Full screen, Android: the page's requestFullscreen does nothing there (dx's
RustWebChromeClient.onShowCustomView only calls super). The Full screen
button now asks MainActivity to hide the system bars (immersive, bars come
back with a swipe, cutout used).
- Full screen, Windows: dioxus's set_fullscreen does nothing when the window
cannot name its monitor; the window goes Borderless(None) through tao
instead.
Versions before beta.17 have no update check at all and need this one
installed by hand.
Checked in an Android 15 emulator: a build stamped beta.14 asks about beta.19
and Update opens Chrome with the APK URL; full screen hides both bars (page
height 684 -> 732 CSS px) and comes back. 74 tests pass. Windows not run here.
Evidence: update prompt and full screen (commit f60a55d)Captured in an Android 15 emulator. The Mac's host name in Nearby is replaced with The app asks to update on start. This build is stamped Update opens the APK in Chrome: Full screen on Android hides the status and navigation bars. The page grows from 412×684 to 412×732 CSS px (the whole screen), and goes back on exit. Windows full screen: not run here (no Windows machine). This PR's Windows build compiles it. |
hello_accepts_only_mullion failed once on GitHub's macOS runner (PR #24): the sweep test starts ~250 connections at once, and on that small machine it held up the other test's reply past hello's 1 s limit. Passed 45 of 45 locally, also under CPU load. The three network tests now share a lock.
- Icons: Pair, Cancel, Don't Allow, Stop sharing, Later and Update have one
next to their word, as the other buttons do. Share this screen gets a cast
icon. Android's "Stop sharing" notification action has an icon.
- Responsive (per the ui-design responsive-design skill):
- The setup screen scrolls when the card is taller than the screen (a
phone in landscape), instead of clipping.
- The footer (version, theme, GitHub, Sponsor) flows under the card
instead of being pinned over it, and wraps on narrow phones.
- On touch screens every control is at least 44x44 px.
- "This device" and "Show" stack on narrow phones.
- On screens under 560 px the toolbar keeps its icons, with the words
hidden from view but still read out.
- The title size is fluid.
- Dark mode (per the dark-mode-design skill):
- A switch in the footer: Auto (follows the system), Light, Dark,
remembered on the device. It works everywhere the page runs (the
Windows and Android apps, the Mac viewer, browsers).
- In dark, raised surfaces get lighter as they rise (cards #171A1E,
dialogs #1E2227, on #0F1113). The colours fade between modes, unless
reduced motion is on.
- Android's app theme is now DayNight: its web view reports the page's
colour scheme from the app theme, and dx's Light theme kept it light.
Checked: Playwright at 320 to 1280 px wide, light and dark: no horizontal
scroll, the footer never covers the card, touch targets at least 44 px. The
switch cycles and survives a reload. In the Android emulator with system dark
mode, the app opens dark. 74 tests pass.
Evidence: icons, responsive layout, dark mode (commit d8a68fe)The colour switch. The footer button cycles Auto (follows the system), Light and Dark, and the device remembers the choice. The Mac's host name is replaced with From left: Light, Dark, and the Android app on Auto with the system in dark mode. The app's theme is now DayNight. Before, dx's Light theme kept the web view light. Checked with Playwright at 320×640, 360×740, 740×360, 820×1180 and 1280×800, in light and dark:
The switch cycles Auto → Light → Dark and keeps the choice after a reload. CI: the macOS run before this one failed in |
hello_accepts_only_mullion failed on GitHub's macOS runner, at once, not on a timeout. `write!` on an unbuffered TcpStream sends each formatted piece as its own write. The test's listener read once, answered, and closed with the rest of the request unread, which resets the connection. The reset can drop the reply before the client reads it, so hello() saw nothing. hello() now formats the request and sends it with one write_all, as lanhttp does. Real hosts read to the end of the headers either way. The test listener reads to the end of the headers before answering. Undoes 962bc0c: the network tests taking turns rested on the wrong theory (a slow machine). The failure came in ~50 ms, not after hello's 1 s limit.
|
❌ The last analysis has failed. |
hello_accepts_only_mullion failed once on GitHub's macOS runner (PR #24): the sweep test starts ~250 connections at once, and on that small machine it held up the other test's reply past hello's 1 s limit. Passed 45 of 45 locally, also under CPU load. The three network tests now share a lock.
On PR #24, a one-file fix ran all three package builds again, though two had already passed. Now a new "changes" job (tools/ci/changed-jobs.sh) decides per package. On a pull request a package is skipped when: - it passed on this PR before, at some commit S (an actual build: a skip never counts, so reuse doesn't chain), and - no file it builds from changed between S and this run's merge commit. What each package builds from: - all three: Cargo.toml/lock, crates/proto, crates/app/assets (the Mac host inlines the page), this workflow and tools/ci. - macos: crates/host, tools/package-macos.sh, tools/macos. - windows: crates/app's src, build.rs and Cargo.toml. - android: crates/app (Kotlin, launcher icons and Dioxus.toml too), crates/host, tools/build-android.sh. Diffing against the merge commit also counts what dev gained since S, so a skip is never wrong; at worst it rebuilds more than needed. If S is gone (a force push) or GitHub's API fails, everything builds. Pushes to dev, tags and manual runs build everything: each release stamps a new version into all three packages. The changes job's summary says, per package, built or reused, and links the run where it passed. Changes only to docs/ or brand/ no longer start a run, as with Markdown. Dry run against PR #24's runs, with a one-file change each: - Kotlin: android only. - App source: windows and android. - The page's CSS or proto: all three. - docs: none. - tools/package-macos.sh: macos only. - A push to dev: all three.







Part 2 of tablet → Mac. Part 1, the host as a library, was #23. This also fixes Android updates.
1. Share this screen (Android)
Share this screen in the Android app makes the tablet a Mirror-only Mullion host:
How it works:
crates/app/android/kotlin):MainActivityasks for consent.ShareService, a foreground service of typemediaProjection, feeds a virtual display into the hardware H.264 encoder. Settings: Baseline, 30 fps, 6 Mbps, long side at most 1920. It repeats the last frame after 100 ms, so a still screen keeps streaming.crates/app/src/share.rs):AndroidPlatformformullion_host. It prepends MediaCodec's SPS/PPS to every IDR (unit tested).poke()while waiting for Android's answer and when the app comes back./helloreports "Android".pair.jsnames the host instead of "the Mac", because a Mac now pairs with tablets too.build-android.sh:2. APK updates install over the old app
Updating failed with "package conflicts". Gradle signs debug builds with
~/.android/debug.keystore, and a fresh CI runner makes a new one each time, so every beta had its own key. The workflow now writes one key there before building, from the newANDROID_DEBUG_KEYSTOREsecret, and the update link no longer says to uninstall first.One last uninstall: apps already installed were signed with the old one-off keys, so the first install of this build still needs an uninstall. Every update after that installs in place.
Testing
cargo test --workspace: 74 pass, including 2 new./helloreports Android;3. The apps ask to update
mullionNative.open, https only). Before, Android's web view did nothing with them and couldn't install a download.4. Full screen on Android and Windows
requestFullscreendoes nothing there, because dx'sRustWebChromeClient.onShowCustomViewonly callssuper. The button now hasMainActivityhide the system bars. Swiping from the edge brings them back.set_fullscreensilently does nothing when the window can't name its monitor. The window now goesBorderless(None)through tao instead. Not run here: there's no Windows machine.Evidence for both is in the second comment.
5. Icons, responsive layout, light/dark switch
nearbytake turns, fixing a flaky failure on the macOS runner.