Wearboard — Truly Remote Input for WearOS
HelloWorld!
It’s interesting how some intellectual conversations over a cup of coffee precipitate in something concrete and tangible.
The other day, my mentor, Gonzalo, and I were catching up at lunch during my internship at TuneIn when we couldn’t help but chat about the “search bar” widget from the TuneIn watch app Figma file. I mean, what’s a media app without search! Indeed, but imagine using the Gboard standard QWERTY layout to key in the words “Padal Varigal” on a 40mm watch screen — and that too without swipe-to-type support! Sounds like Nightmare on “Droid” Street; I’m better off pulling up my phone to do that.
But then again, I’d beg the question, what’s a dedicated watch app if users can’t really derive the full experience? Frankly, even I’m team Google in frowning at the idea of touch typing on ant-sized watch screens just because how cumbersome the process is. Pretty much explains the absence of the `TextField` composable for WearOS apps and instead why developers are encouraged to create a `RemoteInput` intent and `startActivityForResult(…)` to show up a dedicated keyboard on watch apps for input. Fair, but for certain use cases, touch typing on watches is nearly impossible, such as while entering a WiFi password.
Google has this edge case covered with an `AlertDialog` that pops out of nowhere on the phone when you try to input a WiFi password on the watch. This seems to be something hardwired into the OS without a public API that developers can bake into watch apps that can launch that very input dialog on the phone as requested by the watch.
This, essentially, sets the stage for Wearboard — an SDK that can be “plugged” into any Android / WearOS app codebase that lets users decide whether they want to type on their phone or watch to populate a text box on watch apps. Wearboard enforces an intermediate `Activity` on click of a text box widget on their watch that then asks the user to make a decision on how they’d like to fill that text box. If the user chooses “watch” then they’d see a keyboard popup on the watch and if they choose “phone”, a nice input dialog appears on the paired phone app to grab input and then send it over to the watch app. The SDK is flexible enough to let the developer decide how they’d like to implement the “watch” input method — maybe it’s Gboard, maybe it’s something proprietary (like a custom low-profile keyboard, I don’t know). Wearboard’s implementation is tied only to the “phone” input method.
Internally, Wearboard makes use of the Wear DataLayer APIs that stage communication between phones and watches under the Android hood. When a watch app requests for phone input, a blank `Activity` with an input `AlertDialog` appears on the phone app. The developer is free to customize the title of the dialog box from the watch app, which then instructs the phone app to show a customized title. Everything that you see on here is from the Material world through Jetpack Compose. At present, Wearboard uses a custom `MaterialTheme` but I let out dynamic color support in favor of a unified theme for a given watch-phone app pair. Open to discussion.
Why’s it that the phone app should be in foreground for the dialog to appear? A ubiquitous dialog is technically possible with a custom window to draw the dialog on but all of this requires the explicit `SYSTEM_ALERT_WINDOW` permission. Sounds more like an unrelated permission for, maybe, a media player app! Achieving something like the default WiFi password input on the phone from the watch would’ve, ideally, been the best from a UX perspective as. Perhaps, dropping the input dialog entirely in favor of a pop-up notification on the phone is a better alternative? Food for thought.
Finally, thanks to my mentor, Gonzalo, for this awesome idea! An internship at TuneIn was, indeed, a great starting point for exploring the WearOS world. Wearboard turned out to be a nice weekend-long hobby project. Do check out the source and sample phone / watch apps on my GitHub and a quick minute’s worth of demo on my YouTube. I’d love to know your thoughts!