开发者

How does CoreLocation locate the device?

More specifically, does CL require the user to have a data connection? Or is it possible to just use the phones service connectio开发者_StackOverflow社区n?

Thanks!


It actually uses several mechanisms.

  1. GPS
  2. Cell Tower Triangulation
  3. Wifi Hotspot cataloging
  4. Randomly assuming you are in Cupertino

There are tradeoffs based on speed, precision, and available hardware. A first Gen iPad will only have the 3 option available while the iPhone simulator makes use of the last mechanism.

You can observe the difference in these systems in the map application where it initially guesses based on the cell tower, then refines the guess via GPS.

Only options #3 requires a data connection.

And for the humor impaired including #4 was not totally serious although it is functionally correct. (I think they simulate the GPS reporting that location rather than just hard coding it, but I haven't checked.)


You can set the phone into airplane mode and still get a location :)

It will be forced to use GPS to get it so it might take longer to get though.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜