Skip to content

Conversation

@garanj
Copy link
Contributor

@garanj garanj commented Aug 27, 2025

Adds watch face support using Watch Face Push

This PR adds watch face support using Watch Face Push (WFP). This allows the user to create a customized watch face using their generated bot and transfer it to their watch.

Operation

Owing to the way in which Watch Face Push works, this solution requires a Wear OS app: The Watch Face Push API exists only on the watch, and is the only mechanism for adding dynamically-created watch faces to the watch. Outside of WFP, all watch faces must be published through Play.

Compatibility

The watch face feature requires:

  • Min SDK version 28: Some of the libraries used (notably validation) require this
  • A connected Wear OS watch
  • watchface_feature_enabled remote config flag set to true

If these conditions are met, then on the Customize screen, an additional icon is shown bottom-right, for watch faces. If they are not met, then Androidify simply does not show the feature.

image

Watch face installation

On the watch face customization modal screen, the details of the connected device is shown. If Androidify is not installed on the watch, then the button launches the Play Store to install it (if it were there, which it isn't right now).

image

Once installed, the user has the ability to select the watch face they want, and then send to the watch:

image

The app on the watch automatically starts and received the watch face, which is then installed:

image

What happens next depends on a few factors:

  1. If Androidify already controls the active watch face, then it can simply replace it with the new one.
  2. If the app has not asked permission before to set the active watch face, then it can do so, and if granted, the new watch face will be set.
  3. Otherwise, the user will need to manually set the watch face, through long-pressing the watch face.

Note: This logic is all WAI as part of Watch Face Push - apps can only call the API to set the active watch face once.

Architecture

Watch Face Creation

For Watch Face Creation, template Watch Face Format watch faces are included in the assets of the app. These templates all reference a bot drawable, which is the image from Androidify. The template resources and the bot image are packaged together into an APK using the Pack library.

Signing and validation

The built APK must be both signed and then validated using the Watch Face Push validation library. This takes place before transmission.

Transfer

The Wear OS Data Layer APIs are used for transferring the APK for installation using Watch Face Push. Notably:

  • The NodeClient is used to detect connected watches.
  • The CapabilityClient is used to detect presence or absence of Androidify app on the connected devices.
  • The MessageClient is used to initiate transfer requests - only one active transfer can take place at a time. MessageClient is used to request go-ahead to send the APK.
  • The ChannelClient is used to transfer APKs.

The implementation only supports having one connected device. If more than one device is connected to the phone, only one is shown in the Androidify app, prioritizing any that already have the Wear OS Androidify app installed.

Installation

A WearableListenerService-based class is used on the watch to receive and install the watch face using Watch Face Push. This launches any required supporting Activity, to guide the user.

Implementation

  • :watchface module:
    • transfer:
      • WearDeviceRepository - this provides information on:
        • Whether there is a connected Wear OS device
        • Whether that Wear OS device has the Androidify App installed (which is a pre-requisite for watch face transfer)
      • WearAssetTransmitter - this performs the actual transmission of the watch face APK, including:
        • Transmission set up - getting the green light from the receiver to transmit a watch face
        • Actual transmission of the APK file
      • WatchFaceInstallationRepository:
        • Combines:
          • Packaging up the APK in advance, using WatchFaceCreator
          • WearDeviceRepository
          • WearAssetTransmitter
        • Into a single repository for use in the main Androidify app to handle the end-to-end journey of sending a watch face.
    • creator:
      • Contains WatchFaceCreator for creating and signing watch face APKs
      • Contains the template watch face, in assets as exported from Watch Face Designer
  • :wear module
    • Contains the Wear app itself, including AndroidifyDataListenerService which receives requests to initiate watch face transfer over the data layer.
  • :wear:watchface module
    • This is the default watch face included in the Wear OS app: If no watch face has been transferred yet, this is the watch face that will be present as it is installed at the time of Wear OS app installation (and provides another launch point into Androidify on the phone)

Versioning

The PR also proposes a single source for versionCode in Androidify: The Wear OS implementation requires a separate app, with the same package name. This needs to have a separate version code, and ideally a separate version code "space". The single source for versionCode in Versions.kt ensures that both apps increment their version code but do not clash.

@garanj garanj requested review from riggaroo and tiwiz as code owners August 27, 2025 12:54
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @garanj, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive watch face support to the Androidify application, enabling users to create and transfer personalized watch faces featuring their generated bots directly to Wear OS devices. The implementation integrates with the Watch Face Push API, necessitating a companion Wear OS app to manage the creation, signing, validation, and transfer of watch face APKs. This new functionality enhances user customization options and streamlines the process of applying unique designs to smartwatches.

Highlights

  • Watch Face Customization: The Androidify app now supports creating and transferring customized watch faces to Wear OS devices, allowing users to personalize their smartwatches with their unique bot creations.
  • Watch Face Push API Integration: The integration leverages the Watch Face Push API, enabling dynamic installation of watch faces directly to the device without requiring separate Play Store publication for each custom design.
  • Wear OS Companion App: A dedicated Wear OS companion app is now required, as the Watch Face Push API operates directly on the watch. This ensures seamless communication and functionality between the phone and the smartwatch.
  • Compatibility and Feature Flagging: The feature includes compatibility checks, requiring a minimum SDK version 28, a connected Wear OS watch, and an enabled remote configuration flag (watchface_feature_enabled) to ensure proper operation.
  • Technical Architecture and Data Transfer: The architecture for watch face creation involves using Watch Face Format templates, the Pack library for APK packaging, and robust signing and validation processes before transfer. Data transfer is handled efficiently via Wear OS Data Layer APIs, including NodeClient, CapabilityClient, MessageClient, and ChannelClient.
  • Modular Codebase: New modules (:watchface, :wear, :wear:watchface, :wear:common) have been introduced to modularize the codebase, separating concerns related to watch face generation, Wear OS app logic, and common data structures.
  • Centralized Versioning: A unified versioning strategy has been implemented using Versions.kt to provide a single source of truth for versionCode and versionName, ensuring consistent versioning across both the main Androidify application and its new Wear OS counterpart.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive support for creating and transferring custom watch faces to a Wear OS device using Watch Face Push. The changes are well-structured, introducing new modules for watch face creation, data transfer, and the Wear OS app itself. The implementation correctly uses feature flags for the new functionality and centralizes versioning, which is great for maintainability. I have a few suggestions to enhance code safety and maintainability.

@riggaroo
Copy link
Collaborator

riggaroo commented Sep 1, 2025

This looks so lovely Garan 👏🏻 Great great job! ❤️

@riggaroo
Copy link
Collaborator

riggaroo commented Sep 1, 2025

Screenshot_20250901-140829 Screenshot_20250901-140936

PXL_20250901_131002004 MP

@riggaroo
Copy link
Collaborator

riggaroo commented Sep 1, 2025

Nit: When picking a watch face, can you remove the left and right padding and change it to contentPadding instead so that when you scroll its not visible on each side - it scrolls away?

@garanj
Copy link
Contributor Author

garanj commented Sep 2, 2025

Nit: When picking a watch face, can you remove the left and right padding and change it to contentPadding instead so that when you scroll its not visible on each side - it scrolls away?

Done - that looks much better thanks!

# Conflicts:
#	feature/results/src/main/java/com/android/developers/androidify/customize/CustomizeExportScreen.kt
#	feature/results/src/main/java/com/android/developers/androidify/customize/CustomizeExportViewModel.kt
#	feature/results/src/test/kotlin/com/android/developers/androidify/customize/CustomizeViewModelTest.kt
# Conflicts:
#	app/build.gradle.kts
#	feature/results/src/main/java/com/android/developers/androidify/customize/CustomizeExportScreen.kt
#	feature/results/src/main/java/com/android/developers/androidify/customize/CustomizeExportViewModel.kt
#	feature/results/src/test/kotlin/com/android/developers/androidify/customize/CustomizeViewModelTest.kt
@garanj garanj merged commit 2dacd90 into android:main Sep 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants