The Sensors in your iPhone Dr Alasdair Allan Available Hardware Hardware Original iPhone iPhone 1st Gen 2nd Gen 3rd Gen Features iPhone 3G 3GS iPod touch iPod touch iPod touch Cellular Wi-Fi Bluetooth Speaker Audio-In Accelerometer Magnetometer GPS Proximity Sensor Camera Video Vibration The GPS (Core Location) Core Location • Abstraction layer • Cell towers (12km falling to 1-3km) • Skyhook wireless (approx. 100m) • GPS (approx. 40m) Core Location LocationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; if( locationManager.locationServicesEnabled ) { [locationManager startUpdatingLocation]; } else { ... } Distance filters locationManager.distanceFilter = 1000; // 1km Desired accuracy locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; Delegate methods - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if( newLocation != oldLocation ) { ... } } - (void)locationManager:(CLLocationManager *)manager didFailWithError: (NSError *)error { ... } The Accelerometer +Y Y Z +Z X +X
Description: