Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

SENSOREN MOBILER DEVICES Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung AM1 Hauptseminar: Re-usable Content in 3D und.

Ähnliche Präsentationen


Präsentation zum Thema: "SENSOREN MOBILER DEVICES Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung AM1 Hauptseminar: Re-usable Content in 3D und."—  Präsentation transkript:

1 SENSOREN MOBILER DEVICES Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung AM1 Hauptseminar: Re-usable Content in 3D und Simulationssystemen SS 2013 Prof. Manfred Thaller Referent: Nicolas Frings

2 Inhalt Warum Sensoren? Sensortypen GPS-Tutorial

3 Warum Sensoren? Technischer Fortschritt der Smartphones → Vereinfachung der Handhabung (Touch) → Gerade bei Apps essenziell (Navigation/Ortung) Problemstellung: Apps sollen schnell und effizient qualitativ hochwertige Informationen liefern! → Map-Apps Sensoren sind Grundvoraussetzung!

4 Warum Sensoren? Map-Apps Basic Knowledge in iOS: 3 Typen: Web Apps → Nutzen bereits vorhandene Geo-Referenzierungen (Google Maps) → Lediglich Ortung des mobilen devices nötig (Google Maps JavaScript API)

5 Warum Sensoren? Hybrid Apps → Smartphone-Apps welche auf Google Maps im Browser zurückgreifen → Copy-Paste bestehender SDK‘s, Frameworks, etc. → Ebenfalls Ortung des mobilen devices nötig Native Apps → Smartphone-Apps welche auf Apple Maps zurückgreifen → Ortung und Ausrichtung vonnöten (Map Kit API & Core Framework)

6 Sensortypen Kamera Optischer Sensor Schnittstelle: UIImagePickerViewController

7 Sensortypen Magnetometer Sensor erfasst magnetische Ausrichtung und ermöglicht so die präzise Ausrichtung des devices Kombination mit dem Beschleunigungssensor → Ermöglicht Echtzeit-Ausrichtung → Kompass Schnittstelle: CLLocationManager & CoreLocation

8 Sensortypen Mikrofon Audiosensor → Spracheingabe → automatische Lautstärkeregelung Schnittstelle: AV Foundation & Media Player frameworks

9 Sensortypen Beschleunigungssensor / Accelerometer Erfasst 3-achsige Bewegung Rotation (X-Achse) Weite (Y-Achse) Höhe (Z-Achse) Beispiel: Iphone senkrecht auf dem Tisch stehend: x = 0, y = 0, z = 1 Schnittstelle: Keine API im SDK vorhanden!

10 Sensortypen Gyroskop / Kreiselsensor Erweiterung zum Beschleunigungssensor Erfasst präzise das device in sämtlichen Lagen und Positionen → Grundlage für die device-Ortung → Core Framework Schnittstelle Schnittstelle: Core Location Framework

11 GPS-Tutorial Neues Projekt mit der CoreLocation Framework verknüpfen und eine CoreLocationDelegateClass als Objective-C class anlegen.

12 GPS-Tutorial In der.h wird die Klasse definiert. #import @protocol CoreLocationControllerDelegate @required - (void)locationUpdate:(CLLocation *)location; - (void)locationError:(NSError *)error; @end @interface CoreLocationController : NSObject { CLLocationManager *locMgr; id delegate; } @property (nonatomic, retain) CLLocationManager *locMgr; @property (nonatomic, assign) id delegate; @end

13 GPS-Tutorial In der.m werden die eigentlichen core-updates festgelegt #import "CoreLocationController.h„ @implementation CoreLocationController @synthesize locMgr, delegate; - (id)init {self = [super init]; if(self != nil) { self.locMgr = [[[CLLocationManager alloc] init] autorelease]; self.locMgr.delegate = self; } return self; } - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { [self.delegate locationUpdate:newLocation]; } - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { [self.delegate locationError:error]; } - (void)dealloc { [self.locMgr release]; [super dealloc]; } @end

14 GPS-Tutorial Nun noch ein geeignetes UI, welches auf Objekte unserer Klasse zurückgreift. #import #import "CoreLocationController.h" @interface CoreLocationDemoViewController : UIViewController { CoreLocationController *CLController; IBOutlet UILabel *locLabel; } @property (nonatomic, retain) CoreLocationController *CLController; @end

15 GPS-Tutorial Und dann noch das rekursive Update implementieren - (void)viewDidLoad { [super viewDidLoad]; CLController = [[CoreLocationController alloc] init]; CLController.delegate = self; [CLController.locMgr startUpdatingLocation]; } - (void)locationUpdate:(CLLocation *)location { locLabel.text = [location description]; } - (void)locationError:(NSError *)error { locLabel.text = [error description]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; }

16 Vielen Dank!

17 Quellen Andreucci, Pro iOS Geo Allan, Basic Sensors in iOS http://www.vellios.com/2010/08/16/core-location-gps- tutorial/ http://www.vellios.com/2010/08/16/core-location-gps- tutorial/


Herunterladen ppt "SENSOREN MOBILER DEVICES Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung AM1 Hauptseminar: Re-usable Content in 3D und."

Ähnliche Präsentationen


Google-Anzeigen