Lecture 14

Lecture 14 - CS193p Spring 2010 Wednesday Announcements Check out the slides at the end of this presentation and let us know which topics are of

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CS193p Spring 2010 Wednesday, May 12, 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Check out the slides at the end of this presentation and let us know which topics are of the most interest to you Sonali’s ofFce hours changed tomorrow only 4 to 6pm (same place) Update to ±inal Project proposal request In your proposal, include a description of your application as it might appear on the AppStore. Sell us! Wednesday, May 12, 2010
Background image of page 2
To day ’s To pics UIWebView Wednesday, May 12, 2010
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Core Location Framework for managing locations and headings No user-interface, just location information. Basic object is a CLLocation Represented by a latitude and longitude But more than that, also an “accuracy” Because not every location-generating method is as accurate as others. More on this in a few slides . .. Also can encapsulate some other information Course and speed Timestamp (when the measurement of the location was taken) Altitude Wednesday, May 12, 2010
Background image of page 4
CLLocation Properties @property CLLocationCoordinate2D coordinate; typedef struct { CLLocationDegrees latitude; CLLocationDegrees longitude; } CLLocationCoordinate2D; @property CLLocationAccuracy horizontalAccuracy; @property CLLocationAccuracy verticalAccuracy; kCLLocationAccuracyBest; kCLLocationAccuracyNearestTenMeters; kCLLocationAccuracyHundredMeters; kCLLocationAccuracyKilometer; kCLLocationAccuracyThreeKilometers; Wednesday, May 12, 2010
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CLLocation Properties @property CLLocationSpeed speed; // m e t e r s p e r s e c o n d @property CLLocationDirection course; // degrees, 0 is north, clockwise @property CLLocationDistance altitude; // m e t e r s Comparing CLLocation objects - (CLLocationDistance)distanceFromLocation:(CLLocation *)location; Wednesday, May 12, 2010
Background image of page 6
Core Location How do you fnd out where you are? More complicated oF a question than you might think CLLocationManager is the object to use Create using alloc / init , then confgure, then start CLLocationManager *clm = [[CLLocationManager alloc] init]; clm.distanceFilter = 10.0; // minimum distance change to report, in meters clm.desiredAccuracy = kCLLocationAccuracyTenMeters; [clm startUpdatingLocation]; Do not speciFy more accuracy than you need! More accuracy requires more time and more power Cell tower triangulation (not very accurate, but low power) Wi±i node database lookup (more accurate, but more power) GPS (very accurate, lots oF power) Wednesday, May 12, 2010
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Core Location You can then ask the manager for the location CLLocation *location = clm.location; Or, more likely, get notiFed as map view’s delegate - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)location fromLocation:(CLLocation *)oldLocation; User will be asked if it’s okay to check location You can provide a string to tell user the “purpose” of this use @property (copy) NSString *purpose; Delegate gets told of failure - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error; Wednesday, May 12, 2010
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/15/2011 for the course CS 193P taught by Professor Evandoll during the Spring '09 term at Stanford.

Page1 / 31

Lecture 14 - CS193p Spring 2010 Wednesday Announcements Check out the slides at the end of this presentation and let us know which topics are of

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online