开发者

Iphone get coords in background

Can I make iphone app that get coords from gps in 2 seconds and save them in file. In the end of the day I should 开发者_运维知识库send via mail?


You cannot tell the Core Location framework to alert your app every 2 seconds with GPS information. Your app can use the Significant-Change Location Service. So if the device is in a car on the highway, that could well be every 2 seconds. But if the device is traveling by foot, then that depends on how fast the user is walking. Then you can use a Local Notification to alert the user and bring the app from the background at the end of the day.


You can never have GPS location in 2 seconds, only the coordinates from triangulation of wifi signals.


You never know how long the device would take to detect the user's location.

You can of course make an app which should check the user's accurate location and then write it to plist and later whenever you planned to share it via email or any other source, you should able to share it easily.

To get the user's most accurate location look up for the accuracy property in CoreLocation framework. If you considering time limit just for the sake that the user need not to wait until the app gets the accurate location, then you should use background location service introduced in iOS 4.0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜