engage-sdk-integration
它能做什么
这个技能指导在 Android 应用中添加 Google Play Engage SDK。它帮助选择合适的垂直领域和实体,编写发布代码并修复 SDK 错误。适合希望自己的内容显示在 Google Play 推荐位中的 Android 开发者。
适用场景
- ✓当你希望通过 Engage SDK 把应用内容发布到 Google Play 时。
- ✓当你需要把应用的数据类映射到你所在垂直领域的 Engage 实体时。
- ✓当你从 Engage SDK 收到错误,并需要帮助修复的时候。
技能链接
https://github.com/android/skills/blob/main/play/engage-sdk-integration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把 Play Engage SDK 集成到我的美食应用中,使我的食谱可以发布到 Google Play。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会先询问你的应用使用哪个垂直领域和集合,然后读取对应的实体和客户端类的架构。接着它会编写具有所需请求结构的发布代码,并协助调试错误。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
This skill guides you through integrating the Play Engage SDK into an Android app. It ensures that the code follows the mandatory structure and uses the required Engage entities for each vertical.
Workflow
Follow these steps to assist the developer:
Identify vertical and cluster:
- Ask the developer which vertical their app belongs to based on references/schemas/.
- Check if the integration is for TV or mobile. If the integration is for TV, read the TV-specific sections in patterns.md as well.
- Use
{VERTICAL}.mdin the references/schemas/ directory to identify the corresponding Engage entities and theclientclass name. Theclientfield in the JSON provides the full class name. For example,com.google.android.engage.food.service.AppEngageFoodClient. - Note: Initializing the client class requires a
Contextparameter. For example,AppEngageFoodClient(context). - Always refer to common.md for common entities.
- Ask which cluster type they want to publish from the supported cluster types for that vertical.
- Find the method to call from
{VERTICAL}.mdin the references/schemas/ directory for the specified cluster. Each method will specify the request it expects. - Get the request structure from requests.md and clusters from clusters.md. Then suggest and use sources to fill the fields in the request structure correctly, along with the required entities and clusters.
Generate structured boilerplate code:
- Create a new directory for all Engage-related code. Name the directory to match the naming convention of the existing codebase.
- Generate the following classes using templates in patterns.md:
Constants: holds constant values such as attempt counts and publish types.ItemToEntityConverter: converts the app's local models to Engage's Entity models.ClusterRequestFactory: constructs the publish requests.EngageWorker: handles the actual publishing and publish errors using WorkManager.EngagePublisher: orchestrates periodic and one-time jobs.EngageBroadcastReceiver: listens for AppEngageService intents and starts a one-time publish job fromEngagePublisher. Important : Implement both static registration and dynamic registration patterns, including the companion objectregistermethod inside theEngageBroadcastReceiverclass.
Suggest entity mapping:
- Ask the developer to provide their local model schema (for example, a data class or a JSON snippet).
- If they haven't provided one, share entities from
{VERTICAL}.mdin the references/schemas/ directory as a guide. - Once the local model is identified, suggest a mapping to the corresponding Engage entity.
- Generate the conversion logic using the
ItemToEntityConverterpattern in patterns.md and add it to the generated{ENGAGE_CODE_DIR}/ItemToEntityConverter.
Suggest data source:
- Ask the developer to provide the source of actual data you'll publish.
- Once you identify the data source, use it to fetch the data in the app's local model schema.
- Use
{ENGAGE_CODE_DIR}/ItemToEntityConverterto convert this data to an Engage entity. - Use obtained Engage entity model data with
{ENGAGE_CODE_DIR}/ ClusterRequestFactoryto get cluster requests. - Call corresponding cluster publishing method obtained from
{VERTICAL}.mdin the references/schemas/ directory with the obtained request in previous step in{ENGAGE_CODE_DIR}/EngageWorker.
Gradle and manifest updates:
- Suggest updates to
build.gradleandAndroidManifest.xml. - For mobile apps, use patterns.md.
- For TV apps, use the TV-specific sections in patterns.md.
- Provide the necessary
implementationdependencies forbuild.gradleorbuild.gradle.ktsfrom patterns.md. - Provide the
<receiver>and<service>declarations forAndroidManifest.xml. - Note: Except for TV, there aren't any vertical-specific imports. For all other verticals,
com.google.android.engage:engage-core:1.6.0is sufficient.
- Suggest updates to
Debugging and verification:
- **S
常见问题
它也涵盖电视应用吗?
涵盖。如果集成面向电视,该技能也会使用针对电视的指导。
它会先问我问题吗?
会。它会询问你的应用属于哪个垂直领域,以及你想发布哪种集合类型。
它需要我的 Google Play 账户吗?
该技能专注于代码。你自己的账户和控制台设置不在它的覆盖范围之内。
详情
作者的原始描述
Helps developers integrate, debug, and resolve Play Engage SDK implementation issues. Use when adding Engage SDK support, generating publishing code, mapping data classes to entities, or fixing SDK-related errors.
repo: android/skills
热度
- GitHub 星标
- 10k
- 排名
- #11928
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/29
评论
- …
同一仓库的更多技能
agp-9-upgrade
10k帮你的智能体把 Android 应用升级到 Android Gradle Plugin 9,并处理其中的破坏性变更。不适用于多平台项目。
camerax
10k帮你的智能体使用 CameraX 构建 Android 相机功能,包括视频录制、硬件控制以及 ML Kit 和 Media3 效果。
android-for-cars-parked-apps
10k帮你的智能体把 Android 视频、游戏或浏览器应用调整为可在 Android Auto 和 Android Automotive 上以停放应用形式运行。
appfunctions
10k帮你的智能体在 Android 应用中找到关键工作流,并把它们暴露为 AI 智能体和语音命令可以运行的 AppFunctions。