结论:
(1)iOS 可以利用HealthKit读取iOS手机中已经记录的记步数据;
(2)使用后台GPS定位功能可以获取每次GPS位置变更后的坐标,使用坐标数据,可以画出运动轨迹;
(3)结合GPS运动轨迹和记步步数,可以统计出运动量、运动路线;
===关于记步:===
iOS利用HealthKit框架从健康app中获取步数信息
http://www.cnblogs.com/luoxiaofu/p/5259320.html
read stepCount from health app
这是一个简单的示例如何利用healthKit框架从健康app中获取到步数信息
https://github.com/wl356485255/ReadStepCount
官方文档:
The HealthKit Framework
HealthKit框架指南(The HealthKit Framework的中文版)
http://blog.csdn.net/pjk1129/article/details/41678099
Fit: Store and Retrieve HealthKit Data
https://developer.apple.com/library/ios/samplecode/Fit/Introduction/Intro.html
===关于后台记录GPS位置:===
Moves 是如何做到 iOS 后台数据记录的?
https://www.zhihu.com/question/21869458/answer/19572145
官方文档:
参见:#Tracking the User’s Location
The significant-change location service is highly recommended for apps that do not need high-precision location data. With this service, location updates are generated only when the user’s location changes significantly; thus, it is ideal for social apps or apps that provide the user with noncritical, location-relevant information. If the app is suspended when an update occurs, the system wakes it up in the background to handle the update. If the app starts this service and is then terminated, the system relaunches the app automatically when a new location becomes available. This service is available in iOS 4 and later, and it is available only on devices that contain a cellular radio.
简单的说,iOS 提供三种追踪地理位置的模式:
<li>地理位置显著改变服务(推荐)
<li>前台地理位置服务
<li>后台地理位置服务