Skip to content

Latest commit

 

History

History

WatchFaceKotlin

WatchFace Sample (Kotlin)

Demonstrates watch faces using the androidX libraries (Kotlin).

Important

As of July 10, 2024, watch faces must use the Watch Face Format (sample) in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

Introduction

The AndroidX watch face libraries allow you to develop a watch face service in Kotlin. However, WFF is strongly recommended in preference to this approach.

Steps to build in Android Studio

Because a watch face only contains a service, that is, there is no Activity, you first need to turn off the launch setting that opens an Activity on your device.

To do that (and once the project is open) go to Run -> Edit Configurations. Select the app module and the General tab. In the Launch Options, change Launch: to Nothing. This will allow you to successfully install the watch face on the Wear device.

When installed, you will need to select the watch face in the watch face picker, i.e., the watch face will not launch on its own like a regular app.

Screenshots

Analog Watchface

Analog Watchface Config

Analog Watchface Config

Analog Watchface

Getting Started

This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.

Support

If you've found an error in this sample, please file an issue: https://github.com/android/wear-os-samples

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.