{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 14 - CS193p Spring 2010 Wednesday Announcements...

Info icon This preview shows pages 1–10. Sign up to view the full content.

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

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

View Full Document Right 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 office hours changed tomorrow only 4 to 6pm (same place) Update to Final 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
Image of page 2
Today’s Topics Core Location & MapKit UIWebView & WebKit Wednesday, May 12, 2010
Image of page 3

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

View Full Document Right 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
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
Image of page 5

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

View Full Document Right Arrow Icon
CLLocation Properties @property CLLocationSpeed speed; // meters per second @property CLLocationDirection course; // degrees, 0 is north, clockwise @property CLLocationDistance altitude; // meters Comparing CLLocation objects - (CLLocationDistance)distanceFromLocation:(CLLocation *)location; Wednesday, May 12, 2010
Image of page 6
Core Location How do you find out where you are? More complicated of a question than you might think CLLocationManager is the object to use Create using alloc / init , then configure, 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) WiFi node database lookup (more accurate, but more power) GPS (very accurate, lots of power) Wednesday, May 12, 2010
Image of page 7

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

View Full Document Right Arrow Icon
Core Location You can then ask the manager for the location CLLocation *location = clm.location; Or, more likely, get notified 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
Image of page 8
Core Location Heading is similar CLLocationManager *clm = [[CLLocationManager alloc] init]; clm.headingFilter = 10.0; // minimum degree change to report [clm startUpdatingHeading];
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern