Can a separately-compiled complication data source (written in Java/Kotlin) be added to a WFF watchface bundle? If so, how?
Background: I have two deeply-coded scientific-oriented Kotlin watchfaces (SkyHalo and StarHalo) that need to be converted to WFF in order to be available in Wear 5.0, and there's no clear or documented path to do this.
The only possible path I see is to convert the watchface (minus the analog hands) to a SMALL_IMAGE complication data source, and use it in a WFF watchface as a background complication.
Assuming that this is possible, is this an approved way of doing this?
I can 95% confirm that my solution works!
I created a Kotlin data source that performs some mathematical functions and uses the output to create a custom bitmap similar to what SkyHalo does with live data (minus the watchface's analog hands, digital time/date, and complication slots; we'll let WFF handle what it does best). Compiled this to an APK and loaded this onto the emulator.
I then created a WFF watchface containing analog hands, digital time/date, two standard circular complication slots, and one SMALL_IMAGE background complication that was the full size of the watchface. For this last complication, I locked the primarySource to the service name of the data source described in Step (1). This was compiled to an APK using the gradlew command line and loaded onto the emulator. It successfully displayed the Kotlin-coded data source in the background complication, essentially doing an end-run around WFF restrictions to create a smart watchface.
Several tests still need to be done before I write this all up. Using Android Studio I need to bundle the two signed APKs into an AAB, upload it to the Play Store (internal) and have someone with a new Wear 5.0 watch install and test it.
I also need to ensure that the complication updates in a timely manner, and that the data source correctly identifies watchface taps and ambient mode. In addition, the matter of preference-setting needs to be solved; the watchface method of long-pressing and selecting "settings" will only present the WFF-watchface settings, not the data source's settings.
But I'm optimistic that these can be solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With