Skip to content

Latest commit

 

History

History

WatchFaceKotlin

WatchFace Sample (Kotlin)

Demonstrates watch faces using the androidX libraries (Kotlin). The newer Watch Face Format (WFF) is recommended in preference to using these libraries.

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.