Desktop Core Location
IronCoder Live @c4[2]
Description
This is a clean-room implementation of Apple's CoreLocation framework that is part of the iPhone SDK.
It uses Apple's own headers, which are installed when you install the iPhone SDK, as the interface, and implements all the functionality of CoreLocation in an embeddable framework.
It can be made a system-wide framework buy changing its executable path from @loader_path/../Frameworks/
to /Library/Frameworks
.
The Desktop and Phone sample applications are very similar: they both demonstrate using CoreLocation.framework.
How it works
The framework figures out your current, internet-facing IP address using whatismyip.com. It then uses basic IP Geolocation web services to extract latitude and longitude. Results are cached 30 days for each IP address.
There are certainly other IP geolocation services (for instance, SkyHook Wireless) but they required a paid license.
Parano•a
In keeping with the theme, you can drop a file called unauthorizedApps
in /Library/Documents/WebServer/clbl/
and start your webserver. You can then edit the file at will to deny a particular app the use of CoreLocation.
Contents
- PhoneLocation/PhoneLocation.xcodeproj
- Sample application that demonstrates using CoreLocation on the iPhone/iPod Touch.
Build and go, it will find your current location (which, in the Simulator, is 1, Infinite Loop, Cupertino, CA). Press the "Show Me" button to go to these coordinates in Google Maps.
- DesktopLocation/DesktopLocation.xcodeproj
- Sample application that demonstrates using CoreLocation on the Desktop. It uses the Desktop CoreLocation framework in exactly the same manner as PhoneLocation, but the results are pulled from my version of the framework.
Press the "Show Me" button to go to these coordinates in Google Maps.
- CoreLocation/CoreLocation.xcodeproj
- Stand-alone, embeddable framework
Requirements
- MacOSX 10.5
- Latest iPhone SDK. Does not contain any Apple proprietary information.
- Internet connexion