flutter_activity_recognition 套件讓開發者能夠偵測並回應使用者活動,例如在 Android 與 iOS 裝置上的步行、跑步、騎車或駕駛。它利用原生平台 API 提供即時活動辨識,非常適合用於健身追蹤、導航應用與情境感知服務。此外,該套件輕巧且能順暢整合至 Flutter 應用程式中,支援背景活動監控,並提供事件驅動的更新,以有效節省資源。
適用情境
健身與健康追蹤
上下文感知的移動應用
智慧導航系統
基於活動的分析
安全應用的驅動程式檢測
主要特色
即時活動檢測
跨平台支援(Android 與 iOS)
背景活動監控
事件驅動型 API
輕量且高效
適合對象
開發健身應用的開發者
需要使用者上下文感知的應用程式
需要活動洞察的移動應用程式
涉及基於運動觸發的項目
使用建議
兩個平台都需要適當的權限
持續監控可能導致電池用量增加
受限於支援的裝置硬體
可能需要在實體裝置上進行測試
持續活動追蹤的隱私考量
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
This plugin is used to recognize user activity on Android and iOS platforms. To implement this plugin, Android used ActivityRecognitionClient and iOS used CMMotionActivityManager.
Features
Can request activity recognition permission.
Can subscribe to ActivityStream to listen activity in real time.
After adding the flutter_activity_recognition plugin to the flutter project, we need to specify the platform-specific permissions to use for this plugin to work properly.
:baby_chick: Android
Open the AndroidManifest.xml file and add the following permissions between the <manifest> and <application> tags.