Lập trình iPhone part 14

Tôi đang ở đâu?? Tìm đường của bạn với Core Location iPhone của bạn có khả năng để xác định nơi trong từ nó được sử dụng khuôn khổ gọi là Core Location. Thực tế, có ba công nghệ Core Location có thể tận dụng để làm điều này: GPS, dich vụ mạng di động, và Wi-Fi Dịch vụ định vị (WPS | Chapter 14 Where Am I Finding Your Way with Core Location 1 . . . . our iPhone has the ability to determine where in the world it is using a framework called Core Location. There are actually three technologies that Core Location can leverage to do this GPS cell tower triangulation and Wi-Fi Positioning Service WPS . GPS is the most accurate of the three but is not available on first-generation iPhones. GPS reads microwave signals from multiple satellites to determine the current location. Cell tower triangulation determines the current location by doing a calculation based on the locations of the cell towers in the phone s range. Cell tower triangulation can be fairly accurate in cities and other areas with a high cell tower density but becomes less accurate in areas where there is a greater distance between towers. The last option WPS uses the IP address from iPhone s Wi-Fi connection to make a guess at your location by referencing a large database of known service providers and the areas they service. WPS is imprecise and can be off by many miles. All three methods put a noticeable drain on iPhone s battery so keep that in mind when using Core Location. Your application shouldn t poll for location any more often than is absolutely necessary. When using Core Location you have the option of specifying a desired accuracy. By carefully specifying the absolute minimum accuracy level you need you can prevent unnecessary battery drain. The technologies that Core Location depends on are hidden from your application. We don t tell Core Location whether to use GPS triangulation or WPS. 429 430 CHAPTER 14 Where Am I Finding Your Way with Core Location We just tell it how accurate we would like it to be and it will decide which technologies give it the best chance to fulfill your request. The Location Manager The Core Location API is actually fairly easy to work with. The main class we ll work with is CLLocati onManager usually referred to as the Location Manager. In order

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
55    727    5    04-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.