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:
- Watch Face Format overview
- Watch Face Format setup
- XML reference
- Design guidance
- Validator tools and Schema
There are currently five 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.Flavors
- Demonstrates Flavors, a version 2 feature of the Watch Face Format.
Weather
- Current, hourly and daily weather data in the Watch Face Format. Weather is also a version 2 feature. This requires minSdk 34, which is currently available via the Wear OS 5 emulator.
Use Gradle to build each of the samples. For example, to build the
SimpleDigital
debug build:
cd SimpleDigital
./gradlew assembleDebug
Additional commands that you can run from the command-line:
./gradlew validateWff
- This only validates the WFF XML files, but will not build the APK. This task is automatically run as part ofassembleDebug
andbundleDebug
../gradlew validateWffAndInstall [--device <deviceid>]
- builds and validates the watch face, then installs and sets on a connected device or emulator.
For more guidance on building and signing release builds, see signing guidance on developer.android.com
-
Use the XML validator to confirm that the XML in
watchface.xml
is valid. -
Use
logcat
to look for any error messages from the WFF runtime, such as potential errors in WFF expressions.adb logcat --pid=$(adb shell pidof -s com.google.wear.watchface.runtime)
- 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.