---
title: "佳明自定义表盘"
slug: "佳明自定义表盘"
canonical_url: "https://blog.youngoing.cn/posts/%E4%BD%B3%E6%98%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A1%A8%E7%9B%98/"
collection: todo
published_at: 2026-09-10T00:00:00.000Z
updated_at: 2026-09-10T00:00:00.000Z
tags: []
author: youngo
---

## Navigation Context

- Canonical URL: https://blog.youngoing.cn/posts/%E4%BD%B3%E6%98%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A1%A8%E7%9B%98/
- You are here: Home > Posts > todo > 佳明自定义表盘

### Useful Next Links
- [Home](https://blog.youngoing.cn/)
- [rust](https://blog.youngoing.cn/collections/rust/)
- [todo](https://blog.youngoing.cn/collections/todo/)
- [技术](https://blog.youngoing.cn/collections/%E6%8A%80%E6%9C%AF/)

## Garmin / Connect IQ 资源库

### 官方入口

-   [Garmin Connect IQ Developer Portal](https://developer.garmin.com/connect-iq/?utm_source=chatgpt.com)
-   [Connect IQ SDK](https://developer.garmin.com/connect-iq/sdk/?utm_source=chatgpt.com)
-   [Connect IQ API Docs](https://developer.garmin.com/connect-iq/api-docs/?utm_source=chatgpt.com)
-   [Connect IQ Core Topics](https://developer.garmin.com/connect-iq/core-topics/?utm_source=chatgpt.com)
-   [Reference Guides](https://developer.garmin.com/connect-iq/reference-guides/?utm_source=chatgpt.com)

### Monkey C

-   [Monkey C 官方介绍](https://developer.garmin.com/connect-iq/monkey-c/?utm_source=chatgpt.com)
-   [Monkey C Language Reference](https://developer.garmin.com/connect-iq/reference-guides/monkey-c-reference/?utm_source=chatgpt.com)

重点 API：

-   `Toybox.System`
-   `Toybox.Application`
-   `Toybox.WatchUi`
-   `Toybox.Graphics`
-   `Toybox.Time`
-   `Toybox.Time.Gregorian`
-   `Toybox.ActivityMonitor`
-   `Toybox.UserProfile`
-   `Toybox.Sensor`
-   `Toybox.Application.Storage`

### Watch Face

这是你的项目核心。

-   [Watch Faces 官方文档](https://developer.garmin.com/connect-iq/core-topics/watch-faces/?utm_source=chatgpt.com)
-   [Watch Face UX Guidelines](https://developer.garmin.com/connect-iq/user-experience-guidelines/watch-faces/?utm_source=chatgpt.com)

重点关注：

```
WatchFace
WatchFaceView
onUpdate()
onPartialUpdate()

High Power Mode
Low Power Mode
Always-On
AMOLED AOD

屏幕刷新限制
功耗限制
内存限制
Partial Update
多设备适配
```

var e=\[\];function t(t){if(t.dataset.htmlFrameAuto===\`done\`)return;t.dataset.htmlFrameAuto=\`done\`;let n=t.getAttribute(\`style\`)||\`\`;if(t.classList.contains(\`code-rendered-aspect\`)||n.includes(\`--html-frame-height\`)||n.includes(\`--html-frame-aspect-ratio\`))return;let r=t.querySelector(\`iframe.code-iframe\`);if(!r)return;let i=()=>{try{let e=r.contentDocument;if(!e||!e.body)return;let n=Math.max(e.body.scrollHeight,e.body.offsetHeight);if(!n)return;let i=Math.round(window.innerHeight\*.95),a=Math.min(Math.max(n+12,96),i);t.style.setProperty(\`--html-frame-height\`,\`${a}px\`)}catch{}};e.push(i);let a=()=>{i();try{let e=r.contentDocument;e&&e.body&&\`ResizeObserver\`in window&&new ResizeObserver(()=>i()).observe(e.body)}catch{}};r.contentDocument&&r.contentDocument.readyState===\`complete\`?a():r.addEventListener(\`load\`,a)}function n(){let e=document.querySelectorAll(\`\[data-html-frame\]\`);if(!e.length)return;if(!(\`IntersectionObserver\`in window)){e.forEach(t);return}let n=new IntersectionObserver((e,n)=>{for(let r of e)r.isIntersecting&&(n.unobserve(r.target),t(r.target))},{rootMargin:\`250px 0px\`});e.forEach(e=>n.observe(e))}var r=()=>\`requestIdleCallback\`in window?window.requestIdleCallback(n,{timeout:2e3}):setTimeout(n,200);document.readyState===\`complete\`?r():window.addEventListener(\`load\`,r,{once:!0});var i=0;window.addEventListener(\`resize\`,()=>{i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>e.forEach(e=>e()))});

* * *

### 图形与 UI

-   [Toybox.Graphics API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Graphics/?utm_source=chatgpt.com)
-   [Toybox.WatchUi API](https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/?utm_source=chatgpt.com)

主要能力：

```
drawText
drawBitmap

drawLine
drawRectangle
drawCircle
drawArc

fillRectangle
fillCircle

Font
Bitmap
Color
Layout
Drawable
```

你的表盘绝大部分视觉效果，都会在这里完成。

* * *

### 数据 API

#### 运动与健康

-   [Toybox.ActivityMonitor API](https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityMonitor/?utm_source=chatgpt.com)
-   [Toybox.Sensor API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor/?utm_source=chatgpt.com)
-   [Toybox.Activity API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity/?utm_source=chatgpt.com)

可以研究：

```
Steps
Calories
Distance
Floors

Heart Rate
Stress
Body Battery

Sleep
Active Minutes
Pulse Ox

Barometer
Altitude
GPS
Temperature
```

需要注意的是：**不同 Garmin 设备支持的数据和 API 能力不同**。

* * *

### 时间

-   [Toybox.Time API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Time/?utm_source=chatgpt.com)
-   [Toybox.Time.Gregorian API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Time/Gregorian/?utm_source=chatgpt.com)

主要用于：

```
时间
日期
星期

12 / 24 小时制
时区
夏令时
时间格式化
```

* * *

### 设备适配

-   [Supported Devices](https://developer.garmin.com/connect-iq/compatible-devices/?utm_source=chatgpt.com)
-   [Connect IQ Device Reference](https://developer.garmin.com/connect-iq/reference-guides/devices-reference/?utm_source=chatgpt.com)

需要理解：

```
圆形屏幕
方形屏幕

MIP
AMOLED

不同分辨率
不同颜色数量

Touch
Buttons

Device Capability
```

* * *

### 设置与存储

-   [Application Properties](https://developer.garmin.com/connect-iq/core-topics/application-properties/?utm_source=chatgpt.com)
-   [Application Storage API](https://developer.garmin.com/connect-iq/api-docs/Toybox/Application/Storage.html?utm_source=chatgpt.com)

未来如果你的表盘支持：

```
主题颜色
字体
数据字段
布局
显示秒数
隐藏心率
隐藏步数
```

主要会用到这些。

* * *

### VS Code / 开发工具

-   [Garmin VS Code Extension 官方文档](https://developer.garmin.com/connect-iq/reference-guides/visual-studio-code-extension/?utm_source=chatgpt.com)
-   [Connect IQ SDK Manager](https://developer.garmin.com/connect-iq/sdk/?utm_source=chatgpt.com)
-   [Debugging Guide](https://developer.garmin.com/connect-iq/core-topics/debugging/?utm_source=chatgpt.com)
-   [Profiling Guide](https://developer.garmin.com/connect-iq/core-topics/profiling/?utm_source=chatgpt.com)
-   [Unit Testing](https://developer.garmin.com/connect-iq/core-topics/unit-testing/?utm_source=chatgpt.com)

工具链基本就是：

```
VS Code
   +
Monkey C Extension
   +
Connect IQ SDK
   +
Simulator
   +
真实 Garmin 设备
```

* * *

### 性能 / 功耗

-   [Watch Face UX Guidelines](https://developer.garmin.com/connect-iq/user-experience-guidelines/watch-faces/?utm_source=chatgpt.com)
-   [Profiling](https://developer.garmin.com/connect-iq/core-topics/profiling/?utm_source=chatgpt.com)

这个项目里特别值得关注：

```
CPU 时间

内存

Bitmap 占用

Font 占用

GC

绘制次数

每秒刷新

Partial Update

Low Power

Always-On

AMOLED Burn-in
```

这部分其实会是这个项目最有意思的地方。

因为你会真正遇到：

> **不是代码能不能运行，而是能不能在一块低功耗设备上长期运行。**

* * *

### 官方示例与代码

建议从官方 GitHub 生态和 SDK 自带 Samples 入手：

-   [Garmin Connect IQ GitHub Organization](https://github.com/garmin?utm_source=chatgpt.com)
-   [Connect IQ SDK Samples](https://developer.garmin.com/connect-iq/core-topics/getting-started/?utm_source=chatgpt.com)

GitHub 搜索关键词：

```
language:Monkey-C
topic:garmin
topic:connect-iq
watchface
garmin-watchface
connect-iq-watchface
```

可以重点研究：

```
manifest.xml

monkey.jungle

source/

resources/

WatchFaceView

onUpdate()

drawText()

drawBitmap()

设备兼容配置
```

* * *

### 发布

-   [Connect IQ Store](https://apps.garmin.com/?utm_source=chatgpt.com)
-   [Connect IQ Developer Program](https://developer.garmin.com/connect-iq/program/?utm_source=chatgpt.com)
-   [App Submission Guidelines](https://developer.garmin.com/connect-iq/program/publish/?utm_source=chatgpt.com)

最终流程：

```
开发
  ↓
Simulator
  ↓
真机测试
  ↓
生成发布包
  ↓
上传 Connect IQ
  ↓
审核
  ↓
Connect IQ Store
```

* * *

> **Garmin**
> 
> ⬜
> 
> **做一个自定义佳明表盘应用**