Skip to content
A live portfolio. Every project on this page is running now, and every figure is measured by the site itself. Wednesday 30 September 2026 · Nairobi
The LighthouseThe engineering portfolio of Martin Omwenga
Projects / PairBridge · Systems · Runs on your devices

Off the grid: how a laptop and a tablet share files without ever touching the cloud

A Linux PC shows up in every Android file picker, like Google Drive, but the files never leave your own network.

The PC appears in every Android file picker. Every connection is opened by the tablet, never to it.

The problem

Moving a file between a Linux laptop and an Android tablet on the same desk usually means a cloud round trip or a cable. The cloud is slow, sees your files, and needs an account; the cable is never there when you need it.

PairBridge makes the laptop's folders feel local on the tablet: they appear in every Android file picker, next to Google Drive, and any app can open, attach or save to them. Files never leave the local network.

How it works

The laptop runs a small FastAPI server, installed as a background service with one command. The tablet runs a native Android DocumentsProvider, the system interface that storage apps like Google Drive use, so the laptop becomes a storage location in the Files app, Slack, WhatsApp and every other picker. Sharing to "Send to laptop" from any app uploads straight to an inbox folder.

Pairing is a QR code carrying the address and a 256-bit token. If the laptop's address changes, the app finds it again over mDNS.

“The tablet only ever opens connections to the laptop. That one rule shaped every feature.”
1ListListing a folder returns names, sizes and thumbnails rendered on the laptop.
2PreloadFiles under 10 MB download in the background into a cache keyed by path, size and modification time.
3TapOpening a file is served from the cache on disk, not the network.
4RefreshThe next listing notices changed files and replaces them.
Why opening a file feels instant, even though the tablet's WiFi radio sleeps.

Key decisions

What was chosen, why, and what it costs.

Outbound connections only

The choice. Every feature is built on requests the tablet makes to the laptop; sending to the laptop is an upload, not a pull.

Why. The target tablet's OS (HyperOS) silently drops inbound connections to ordinary apps over WiFi. A written investigation ruled out permissions, battery limits, IPv6, firewalls and Android's local-network rules before settling on the design.

The trade-off. Mounting the tablet's files on the laptop stays experimental until a device allows inbound connections.

Speak the system's storage interface

The choice. A DocumentsProvider (Android's Storage Access Framework) instead of a custom file browser.

Why. Every app's file picker gets the laptop for free, with thumbnails, opening, saving and renaming.

The trade-off. Apps that edit files in place (read-write mode) can't save to the laptop, because streamed writes aren't seekable.

Hide the radio's wake-up cost

The choice. Preload small files and render thumbnails on the laptop.

Why. The tablet's WiFi radio sleeps after a few seconds, and the next packet costs one to three seconds, measured by matching server and app logs.

The trade-off. A file changed on the laptop is only noticed when its folder is listed again.

Stream, and write atomically

The choice. Transfers stream through pipes; uploads land in a temporary file renamed into place when complete.

Why. Large files never sit in memory, an app never receives a truncated file as if it were whole, and a dropped connection leaves the original untouched.

The trade-off. None worth noting.

How it is tested

The laptop's server is tested with pytest: authentication, path traversal and symlink escapes out of shared folders, atomic writes, upload limits, collision-free naming, thumbnails, config file permissions and the CLI. CI runs them and builds the Android app on every push.

What it doesn't do yet

Traffic is plain HTTP on the local network, so someone on the same WiFi who captures the token can read and change the shared folders. TLS with the certificate pinned through the pairing QR code is the next item on the roadmap, followed by a clipboard drop zone.

Read the code Read the code and the HyperOS investigation.
← All projects