如何使用iphone计算我们的汽车速度 [英] How to calculate speed of our car using iphone

查看:109
本文介绍了如何使用iphone计算我们的汽车速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的应用程序,我想用iphone计算我的汽车/自行车速度。我怎样才能做到这一点?理想情况下,它应该在后台连续运行。

For my application I want to calculate my car/bike speed using iphone. How can i do that? Ideally, it should run continuously in the background.

推荐答案

CLLocation包含一个 speed 属性将为您提供设备的当前速度。 (请注意该链接的准确性评论。)

CLLocation includes a speed property that will give you the current speed of the device. (Note the comment about the accuracy at that link.)

要获取用户的当前位置,请按照位置感知编程指南 ,在获取用户的当前位置下。

To get the user's current location, follow the steps in the Location Awareness Programming Guide, under "Getting the User's Current Location".

最后,要在后台启用位置更新,请参阅在后台接收位置事件 iOS应用程序编程指南。

Finally, to enable location updates in the background, see Receiving Location Events in the Background in the iOS Application Programming Guide.

这篇关于如何使用iphone计算我们的汽车速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆