Maps, geolocation, and geofencing - windows phone 8.1

3,962 views

Published on

http://winstore.vn

Published in: Mobile, Business, Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,962
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
87
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Maps, geolocation, and geofencing - windows phone 8.1

  1. 1. 30 April 2014 Building Apps for Windows Phone 8.1 Jump Start WinRT Apps & Silverlight
  2. 2. // The URI to launch string uriToLaunch = @"bingmaps:?cp=51.501156~-0.141706&lvl=17"; var uri = new Uri(uriToLaunch); Windows.System.Launcher.LaunchUriAsync(uri);
  3. 3. // The URI to launch string uriToLaunch = @"ms-drive-to:?destination.latitude=47.6451413797194" + "&destination.longitude=-122.141964733601&destination.name=Redmond, WA"; var uri = new Uri(uriToLaunch); Windows.System.Launcher.LaunchUriAsync(uri);
  4. 4. Location service Core logic CellWiFiGNSS Geofence core Geofencing WinRT API Geofences Microsoft Positioning Services Geocoordinate .NET API Geofence software tracking Geolocation WinRT API
  5. 5. Geolocator geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 50; try { Geoposition geoposition = await geolocator.GetGeopositionAsync( maximumAge: TimeSpan.FromMinutes(5), timeout: TimeSpan.FromSeconds(10) ); LatitudeTextBlock.Text = geoposition.Coordinate.Latitude.ToString("0.00"); LongitudeTextBlock.Text = geoposition.Coordinate.Longitude.ToString("0.00"); } catch (UnauthorizedAccessException) { // the app does not have the right capability or the location master switch is off StatusTextBlock.Text = "location is disabled in phone settings."; }
  6. 6. private void TrackLocation_Click(object sender, RoutedEventArgs e) { if (!tracking) { geolocator = new Geolocator(); geolocator.DesiredAccuracy = PositionAccuracy.High; geolocator.MovementThreshold = 100; // The units are meters. geolocator.StatusChanged += geolocator_StatusChanged; geolocator.PositionChanged += geolocator_PositionChanged; tracking = true; } else { geolocator.PositionChanged -= geolocator_PositionChanged; geolocator.StatusChanged -= geolocator_StatusChanged; geolocator = null; tracking = false; } }
  7. 7. await MapRouteFinder await MapRouteFinder MapRouteOptimization await MapRouteFinder
  8. 8. await MapLocationFinder await MapLocationFinder
  9. 9. Location service Geofences storage App AppApp Create fences Trigger task (BG) Fence notification (FG) Background core Read notification info Hardware based tracking Geofence tracking for all apps GeofenceMonitor Optimized, adaptive software tracking
  10. 10. Id Required String N/A Geoshape Required Geocircle (BasicGeoposition + Radius) N/A MonitoredStates Optional Entered/Exited/Removed Entered/Exited SingleUse Optional True/False False DwellTime Optional Timespan 10s StartTime Optional DateTimeOffset 0/epoch Duration Optional Timespan 0/forever
  11. 11. ©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

×