我正在用三星手表4收集原始传感器数据(心率、加速度计、陀螺仪等).我需要在后台连续运行我的数据收集应用程序.然而,watch OS似乎在一段时间后终止了应用程序.
所以我的问题是-How can I keep my application running in the background continuously without being interrupted/killed by the watch OS?
我正在用三星手表4收集原始传感器数据(心率、加速度计、陀螺仪等).我需要在后台连续运行我的数据收集应用程序.然而,watch OS似乎在一段时间后终止了应用程序.
所以我的问题是-How can I keep my application running in the background continuously without being interrupted/killed by the watch OS?
Health Services https://developer.android.com/training/wearables/health-services是处理心率问题的方法,因此你不需要你的应用程序一直运行.
但如果你需要加速计和陀螺仪,你需要收集自己,然后你将不得不运行一个前台服务.
https://developer.android.com/guide/components/foreground-services
但如果你只需要加速计和陀螺仪来检测运动,那么WHS可以为你做这件事.