Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

iOS4時代の位置情報サービスの使い方

on

  • 9,855 views

MOSA Software Meeting ...

MOSA Software Meeting 2010でCoreLocationサービスの使い方についてセッションを行いました。「駅ベル」で得た位置情報サービスの実情を踏まえた内容になっています。

Statistics

Views

Total Views
9,855
Views on SlideShare
9,759
Embed Views
96

Actions

Likes
18
Downloads
75
Comments
0

7 Embeds 96

http://basuke.com 76
http://paper.li 11
http://twitter.com 3
https://twitter.com 3
http://b.hatena.ne.jp 1
http://a0.twimg.com 1
http://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • &#x3053;&#x3093;&#x306A;&#x30E2;&#x30CE;&#x3092;&#x4F5C;&#x3063;&#x3066;&#x307E;&#x3059;&#x3002;&#x6B21;&#x306F;&#x30B9;&#x30AF;&#x30EA;&#x30FC;&#x30F3;&#x30B7;&#x30E7;&#x30C3;&#x30C8; <br />
  • &#x30C7;&#x30E2;&#x3057;&#x307E;&#x3057;&#x3087;&#x3046;&#x3002; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x3068;&#x8A00;&#x3046;&#x3053;&#x3068;&#x3092;&#x8E0F;&#x307E;&#x3048;&#x305F;&#x4E0A;&#x3067;&#x3001;&#x305D;&#x308C;&#x3067;&#x3082;&#x3084;&#x308A;&#x305F;&#x3044;&#x3068;&#x3044;&#x3046;&#x4EBA;&#x306E;&#x305F;&#x3081;&#x306E;&#x30BB;&#x30C3;&#x30B7;&#x30E7;&#x30F3;&#x3067;&#x3059; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x304A;&#x305D;&#x3089;&#x304F;&#x3001;&#x30C7;&#x30D0;&#x30A4;&#x30B9;&#x306E;&#x4E2D;&#x306B;DB&#x304C;&#x3042;&#x308B;&#x306E;&#x3067;&#x306F;&#xFF1F; <br />
  • <br />
  • GPS&#x4E07;&#x6B73;&#x3001;&#x3068;&#x3044;&#x3046;&#x308F;&#x3051;&#x3067;&#x306F;&#x306A;&#x3044;&#x3002; <br />
  • <br />
  • &#x6982;&#x7565;&#x306F;&#x5168;&#x3066;&#x8A71;&#x3057;&#x3066;&#x3057;&#x307E;&#x3046;&#x3053;&#x3068;&#x3002; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x30D0;&#x30C3;&#x30AF;&#x30B0;&#x30E9;&#x30A6;&#x30F3;&#x30C9;&#x306E;&#x51E6;&#x7406;&#x306B;&#x3064;&#x3044;&#x3066;&#x306F;&#x5F8C;&#x8FF0; <br />
  • <br />
  • &#x610F;&#x5916;&#x3068;&#x91CD;&#x8981;&#x3001;&#x30C6;&#x30B9;&#x30C8;&#x3057;&#x3065;&#x3089;&#x3044; <br />
  • <br />
  • &#x3053;&#x3053;&#x304B;&#x3089;&#x672C;&#x984C;&#x3002;&#x30D7;&#x30E9;&#x30A4;&#x30D0;&#x30B7;&#x30FC;&#x306E;&#x8A71;&#x306F;&#x3001;&#x30A2;&#x30D7;&#x30EA;&#x304C;&#x8D77;&#x52D5;&#x3057;&#x7D9A;&#x3051;&#x308B;&#x3053;&#x3068;&#x306B;&#x5BFE;&#x3059;&#x308B;&#x56DE;&#x7B54;&#x3002;&#x8A2D;&#x5B9A;&#x30A2;&#x30D7;&#x30EA;&#x306E;&#x7D30;&#x304B;&#x3044;&#x8A2D;&#x5B9A;&#x3002;prompt&#x3002; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x30D0;&#x30C3;&#x30C6;&#x30EA;&#x30FC;&#x3002;&#x30EF;&#x30FC;&#x30CB;&#x30F3;&#x30B0;&#x306F;&#x8D77;&#x304D;&#x305F;&#x3068;&#x304D;&#x306B;&#x6765;&#x307E;&#x3059;&#x3002;&#x9045;&#x3059;&#x304E;&#x307E;&#x3059;&#x3002; <br />
  • &#x30D0;&#x30C3;&#x30C6;&#x30EA;&#x30FC;&#x3001;&#x6BBA;&#x3055;&#x308C;&#x305F;&#x3068;&#x304D;&#x306E;&#x51E6;&#x7406;&#x3002;Watchdog&#x304C;&#x6BBA;&#x3059;&#x3002;&#x30E6;&#x30FC;&#x30B6;&#x30FC;&#x3082;&#x6BBA;&#x3059;&#x3002; <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • &#x6B21;&#x3067;&#x6700;&#x5F8C;&#x3002;PinkPig <br />
  • <br />
  • <br />

iOS4時代の位置情報サービスの使い方 iOS4時代の位置情報サービスの使い方 Presentation Transcript

  • CoreLocation on iOS 4 iOS4 @basuke
  • 2008 3 2010 6 iOS4
  • Agenda
  • Agenda
  • Agenda CoreLocation
  • Agenda CoreLocation iOS 4
  • Agenda CoreLocation iOS 4
  • Agenda CoreLocation iOS 4
  • Cell Wi-Fi GPS
  • Cell OK 10-50km
  • Wi-Fi Wi-Fi iOS 3.2
  • GPS GPS iPad GPS x3 x1/3 Wi-Fi ↑ ↑ CLLocationAccuracyBestForNavigation
  • GPS > Wi-Fi > Cell GPS > Wi-Fi > Cell GPS > Wi-Fi > Cell
  • iPhone, iPad 3G iPod touch, Mac Wi-Fi
  • CoreLocation CoreLocation CLLocationManager Delegate CLLocation
  • API GPS
  • CLLocationManager CLLocationManager desiredAccuracy distanceFilter delegate start / stop
  • delegate locationManager:didUpdateToLocation: fromLocation: locationManager:didFailWithError:
  • - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { // } - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { // }
  • delegate CLLocationManager Your App Object <CLLocationManagerDelegate>
  • delegate CLLocationManager CLLocation Your App Object <CLLocationManagerDelegate>
  • delegate CLLocationManager CLLocation Your App Object <CLLocationManagerDelegate>
  • CLLocation CLLocationCoordinate2D latitude longitude
  • Significant Location Change Location Region Monitoring
  • Significant Location Change Cell delegate
  • Region Monitoring / Cell delegate
  • 4.0 delegate kCLErrorDenied 4.1 prompt
  • MapKit CoreLocation
  • iOS 4 API
  • Info.plst Required Background Modes background
  • NSTimer
  • BG
  • BG Significant Location Change
  • BG Local Notification
  • BG
  • MapKit MKMapView.showUserLocation = YES BG NO LocatinManager /System/Library/Frameworks/MapKit.framework
  • Significant Location Change Region Monitoring
  • Your App<Delegate> Location Service Daemon CLLocationManager OS
  • Other App Your App<Delegate> Location Service Daemon CLLocationManager OS
  • Other App Location Service Daemon OS
  • Other App Location Service Daemon OS
  • Other App Loc Location Service Daemon OS
  • Other App Loc Your App<Delegate> Location Service Daemon OS
  • Other App Loc Your App<Delegate> Location Service Daemon CLLocationManager OS
  • Other App Loc Your App<Delegate> Location Service Daemon CLLocationManager OS
  • Other App Your App<Delegate> Location Service Daemon CLLocationManager Loc OS
  • Other App Your App<Delegate> Location Service Loc Daemon CLLocationManager OS
  • Other App Your App<Delegate> Location Loc Service Daemon CLLocationManager OS
  • BG CLLocationManager
  • Significant Location Change Region Monitoring BG
  • 3G
  • MVC
  • Tracker PPGLocationService PPGLocationClient PPGLocationService
  • CLLocationManager LocMgr prompt delegate
  • PPGLocationService M CLLocationManager delegate PPGLocationClient KVO
  • PPGLocationClient C M PPGLocationService PPGLocationService 1:N property Invocation, Delegate, Notification
  • 50m BG 300m BG NearbyViewController MapViewController <PPGLocationClient> <PPGLocationClient> Tracker <PPGLocationClient> 1km BG On PPGLocationService CLLocationManager
  • Tracker M PPGLocationClient best 2
  • BG
  • BG Bluetooth
  • iOS4 iPhone
  • KVO Notification Notification OK KVO ChangedNotification
  • KVO 1:N looser cuppling, delegate 1:1 property
  • KVO [target addObserver:observer forKeyPath:path options:options context:nil] NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial
  • - (void)registerClient:(NSObject<PPGLocationServiceDelegate> *)aClient { [clients_ addObject:aClient]; KVO_REGISTER(self, aClient, @"distanceFilter"); KVO_REGISTER(self, aClient, @"desiredAccuracy"); KVO_REGISTER(self, aClient, @"needLocation"); } - (void)unregisterClient:(NSObject<PPGLocationServiceDelegate> *)aClient { KVO_UNREGISTER(self, aClient, @"distanceFilter"); KVO_UNREGISTER(self, aClient, @"desiredAccuracy"); KVO_UNREGISTER(self, aClient, @"needLocation"); [clients_ removeObject:aClient]; [self updateClientsDemand]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqual:@"distanceFilter"]) { // ... } if ([keyPath isEqual:@"desiredAccuracy"]) { // ... } if ([keyPath isEqual:@"needLocation"]) { // ... } }
  • - (void)registerClient:(NSObject<PPGLocationServiceDelegate> *)aClient { [clients_ addObject:aClient]; KVO_REGISTER(self, aClient, @"distanceFilter"); KVO_REGISTER(self, aClient, @"desiredAccuracy"); KVO_REGISTER(self, aClient, @"needLocation"); } - (void)unregisterClient:(NSObject<PPGLocationServiceDelegate> *)aClient { KVO_UNREGISTER(self, aClient, @"distanceFilter"); KVO_UNREGISTER(self, aClient, @"desiredAccuracy"); KVO_UNREGISTER(self, aClient, @"needLocation"); [clients_ removeObject:aClient]; [self updateClientsDemand]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqual:@"distanceFilter"]) { // ... } if ([keyPath isEqual:@"desiredAccuracy"]) { // ... } if ([keyPath isEqual:@"needLocation"]) { // ... } }
  • PPGLocationService 8 NSTimer BG
  • DEBUG HACK BG 10 UIApplication beginBackgroundTaskWithExpiratio nHandler:(void(^)(void))handler RequiredBackgroundModes=audio
  • Breadcrumps - plist or JSON Document Interaction iTunes MapKit
  • PinkPig iPhone Inspired by MediaProbe Three20 GitHub
  • Thank you http://basuke.com/ Twitter: @basuke
  • Thank you ... and Q&A? http://basuke.com/ Twitter: @basuke