A sample demonstrating the structure of Watch Face Format watch faces
The Watch Face Format (WFF) allows developers to build watch faces, and watch face design tools in a XML format.
This sample demonstrates the basic structure of a WFF watch face, and how it should be packaged for uploading to Play or for local testing on an emulator or device.
For more details on the Watch Face Format, see:
There are currently three samples available:
SimpleDigital
- A basic digital watch face.SimpleAnalog
- A basic analog watch face.Complications
- Demonstrates using Complications in a watch face and rendering data from Complication data sources.
This sample uses a shell script to demonstrate the packaging of the watch face.
You will need to set a handful of environment variables first:
ANDROID_HOME
- path to your SDK installation, for example on Mac:/Users/<my_user>/Library/Android/sdk
AAPT2
- path to the AAPT2 binary, for example:$ANDROID_HOME/build-tools/<version>/aapt2
ANDROID_JAR
- path to the Android JAR, for example:$ANDROID_HOME/platforms/android-<version>/android.jar
BUNDLETOOL
- path to the Bundle Tool. On Mac, this can be installed usingbrew install bundletool
From the WatchFaceFormat
directory, execute:
./build-wff.sh SimpleDigital
(the same applies for SimpleAnalog
and Complications
)
This will build the watch face in a few formats, notably:
SimpleDigital/out/mybundle.aab
- a bundle suitable for upload to PlaySimpleDigital/out/result_apks/universal.apk
- an APK, for easy deployment to a local device.
On a Wear 4 device, such as the Wear emulator:
-
install the watch face:
adb install SimpleDigital/out/result_apks/universal.apk
-
Long press on the current watch face, and locate the option to select further watch faces. Choose the Simple Digital watch face.
- Stack Overflow: https://stackoverflow.com/questions/tagged/wear-os
- Error Reporting: If you've found an error in this sample, please file an issue: https://github.com/android/wear-os-samples
- Submitting Patches: Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.