How to calculate speed of our car using iphone

ぐ巨炮叔叔 提交于 2019-11-27 13:13:13

问题


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.


回答1:


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".

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




回答2:


the only way i can think of is thru GPS. the accelerometer is out. but im not sure if enough information is provided thru "GPS API".



来源:https://stackoverflow.com/questions/3818902/how-to-calculate-speed-of-our-car-using-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!