使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Wear 表盘推送
借助表盘推送功能,Wear OS 应用可以程序化地在手表上安装表盘。
最近更新时间 |
稳定版 |
候选版 |
Beta 版 |
Alpha 版 |
2025 年 6 月 18 日 |
- |
- |
- |
1.0.0-alpha01 |
声明依赖项
如需添加 Wear 表盘推送的依赖项,您必须将 Google Maven 制品库添加到项目中。如需了解详情,请参阅 Google 的 Maven 代码库。
在应用或模块的 build.gradle
文件中添加所需工件的依赖项:
Groovy
repositories {
google() // For the watchfacepush library itself
}
dependencies {
implementation "androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01"
}
Kotlin
repositories {
google() // For the watchfacepush library itself
}
dependencies {
implementation("androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01")
}
此外,如果应用需要在运行时为表盘生成令牌,请添加以下依赖项:
Groovy
repositories {
google() // For the validator-push library itself
maven {
url "https://jitpack.io" // For dependencies of the validator-push library
content {
includeGroup "com.github.xgouchet"
}
}
}
dependencies {
implementation "com.google.android.wearable.watchface.validator:validator-push:1.0.0-alpha06"
}
Kotlin
repositories {
google() // For the validator-push library itself
maven {
url = uri("https://jitpack.io") // For dependencies of the validator-push library
content {
includeGroup("com.github.xgouchet")
}
}
}
dependencies {
implementation("com.google.android.wearable.watchface.validator:validator-push:1.0.0-alpha06")
}
如需详细了解依赖项,请参阅添加 build 依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库有任何改进建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
创建新问题
如需了解详情,请参阅问题跟踪器文档。
版本 1.0
版本 1.0.0-alpha01
2025 年 6 月 18 日
发布了 androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01
。版本 1.0.0-alpha01 包含这些提交内容。
API 变更
- 添加了表盘推送 API,让 Wear OS 应用能够以编程方式在手表上安装表盘。
- 该 API 之前以
:wear:watchface:watchface-push
的形式发布
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-22。
[null,null,["最后更新时间 (UTC):2025-08-22。"],[],[],null,["# wear watchfacepush\n\nWear Watch Face Push\n====================\n\nAPI Reference \n[androidx.wear.watchfacepush](/reference/kotlin/androidx/wear/watchfacepush/package-summary) \nWatch Face Push allows a Wear OS app to install a watch face on a watch programmatically. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|---------------|----------------|-------------------|--------------|------------------------------------------------------------------------------|\n| June 18, 2025 | - | - | - | [1.0.0-alpha01](/jetpack/androidx/releases/wear-watchfacepush#1.0.0-alpha01) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Wear Watch Face Push, you must add the Google Maven\nrepository to your project.\nRead [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\nrepositories {\n google() // For the watchfacepush library itself\n}\ndependencies {\n implementation \"androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01\"\n}\n```\n\n### Kotlin\n\n```kotlin\nrepositories {\n google() // For the watchfacepush library itself\n}\n\ndependencies {\n implementation(\"androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01\")\n}\n```\nAdditionally, if the app needs to generate tokens for a watch face at runtime, add the following dependency: \n\n### Groovy\n\n```groovy\nrepositories {\n google() // For the validator-push library itself\n maven {\n url \"https://jitpack.io\" // For dependencies of the validator-push library\n content {\n includeGroup \"com.github.xgouchet\"\n }\n }\n}\n\ndependencies {\n implementation \"com.google.android.wearable.watchface.validator:validator-push:1.0.0-alpha06\"\n}\n```\n\n### Kotlin\n\n```kotlin\nrepositories {\n google() // For the validator-push library itself\n maven {\n url = uri(\"https://jitpack.io\") // For dependencies of the validator-push library\n content {\n includeGroup(\"com.github.xgouchet\")\n }\n }\n}\n\ndependencies {\n implementation(\"com.google.android.wearable.watchface.validator:validator-push:1.0.0-alpha06\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1235337%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1235337&template=1726812)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha01\n\nJune 18, 2025\n\n`androidx.wear.watchfacepush:watchfacepush:1.0.0-alpha01` is released. Version 1.0.0-alpha01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/e8af6ab7417811bf386c52a59ab5d0b94d194eeb/wear/watchfacepush/watchfacepush).\n\n**API Changes**\n\n- Added the Watch Face Push API which allows a Wear OS app to install a watch face on a watch programmatically.\n- The API was previously published as `:wear:watchface:watchface-push`"]]