Skip to content

探索手錶功能整合(Wear OS / Apple Watch) #161

Description

@abc873693

Summary

探索在 ap_common_plugin 中整合智慧手錶功能的可行性,讓校務通系列 App 可在手錶上顯示課表資訊。

Motivation

學生在校園中經常需要快速查看下一堂課的資訊(課名、時間、教室),手錶是最自然的快速查看載體。目前 ap_common_plugin 已有 Android 課表桌面小工具(CourseAppWidgetProvider),資料讀取邏輯可複用至手錶平台。

平台可行性

平台 可行性 做法
Wear OS ⭐⭐⭐ 高 可用 wear package 建 Flutter watch UI,或透過 Data Layer API 同步資料
Apple Watch ⭐⭐ 中 Flutter 不支援 watchOS,需用 SwiftUI 寫原生 companion app,透過 WatchConnectivity 溝通

建議架構

Flutter App (iOS/Android)
  │
  ├─ ap_common_plugin (MethodChannel)
  │     ├─ Android: Data Layer API → Wear OS Tile/App
  │     └─ iOS: WatchConnectivity → watchOS SwiftUI App
  │
  └─ SharedPreferences (課表資料來源,現有機制)

手錶顯示內容

  • 下一堂課(名稱、時間、教室)— 現有桌面小工具已有此邏輯
  • 今日課表 — 快速一覽
  • 上課倒數計時 — Complication / Tile
  • 課堂提醒通知 — 課前 15 分鐘推播

建議實作順序

Phase 1:Wear OS Tile(課表磚)

  • 複用 CourseAppWidgetProvider 邏輯,改用 Tiles API
  • 顯示下一堂課資訊
  • 工程量最小、複用度最高

Phase 2:Apple Watch Complication

  • SwiftUI 原生 complication 顯示「下一堂課」
  • 透過 WatchConnectivity 從 Flutter app 同步課表資料
  • ap_common_plugin iOS 端擴充 MethodChannel

Phase 3:完整手錶 App(可選)

  • Wear OS 獨立 App(圓形螢幕適配)
  • Apple Watch App(今日課表瀏覽)

相關套件

相關程式碼

  • packages/ap_common_plugin/android/.../CourseAppWidgetProvider.kt — 現有 Android 課表小工具
  • packages/ap_common_plugin/android/.../Course.kt — 課程資料模型
  • packages/ap_common_plugin/ios/Classes/SwiftApCommonPlugin.swift — iOS plugin stub

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions