[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

WatchFaceFormat

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Watch Face Format Sample

A sample demonstrating the structure of Watch Face Format watch faces

Introduction

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:

Samples

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.

Flavors

  • 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.

Weather

Building the samples

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 of assembleDebug and bundleDebug.
  • ./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

Debugging

  1. Use the XML validator to confirm that the XML in watchface.xml is valid.

  2. 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)

Support