SlideShare a Scribd company logo
30 April 2014
Building Apps for Windows Phone 8.1 Jump Start
WinRT Apps
& Silverlight
// The URI to launch
string uriToLaunch = @"bingmaps:?cp=51.501156~-0.141706&lvl=17";
var uri = new Uri(uriToLaunch);
Windows.System.Launcher.LaunchUriAsync(uri);
// 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);
Location service
Core logic
CellWiFiGNSS
Geofence
core
Geofencing
WinRT API
Geofences
Microsoft
Positioning
Services
Geocoordinate
.NET API
Geofence
software
tracking
Geolocation
WinRT API
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.";
}
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;
}
}
await
MapRouteFinder
await
MapRouteFinder
MapRouteOptimization
await
MapRouteFinder
await
MapLocationFinder
await
MapLocationFinder
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
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
©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.

More Related Content

Viewers also liked

Sicp 2.2 계층 구조 데이터와 닫힘 성질
Sicp 2.2 계층 구조 데이터와 닫힘 성질Sicp 2.2 계층 구조 데이터와 닫힘 성질
Sicp 2.2 계층 구조 데이터와 닫힘 성질
aceigy6322
 
The history of calculus
The history of calculusThe history of calculus
The history of calculus
pouline16
 

Viewers also liked (11)

21 app packaging, monetization and publication
21   app packaging, monetization and publication21   app packaging, monetization and publication
21 app packaging, monetization and publication
 
15 sensors and proximity nfc and bluetooth
15   sensors and proximity nfc and bluetooth15   sensors and proximity nfc and bluetooth
15 sensors and proximity nfc and bluetooth
 
10 sharing files and data in windows phone 8
10   sharing files and data in windows phone 810   sharing files and data in windows phone 8
10 sharing files and data in windows phone 8
 
14 tiles, notifications, and action center
14   tiles, notifications, and action center14   tiles, notifications, and action center
14 tiles, notifications, and action center
 
Sicp 2.2 계층 구조 데이터와 닫힘 성질
Sicp 2.2 계층 구조 데이터와 닫힘 성질Sicp 2.2 계층 구조 데이터와 닫힘 성질
Sicp 2.2 계층 구조 데이터와 닫힘 성질
 
The history of calculus
The history of calculusThe history of calculus
The history of calculus
 
Warp
WarpWarp
Warp
 
Mem shrink
Mem shrinkMem shrink
Mem shrink
 
16 interacting with user data contacts and appointments
16   interacting with user data contacts and appointments16   interacting with user data contacts and appointments
16 interacting with user data contacts and appointments
 
Cultura emprendedora wiki.
Cultura emprendedora wiki.Cultura emprendedora wiki.
Cultura emprendedora wiki.
 
Growth Hacking: Offbeat Ways To Grow Your Business
Growth Hacking: Offbeat Ways To Grow Your BusinessGrowth Hacking: Offbeat Ways To Grow Your Business
Growth Hacking: Offbeat Ways To Grow Your Business
 

More from WindowsPhoneRocks

More from WindowsPhoneRocks (12)

3 554
3 5543 554
3 554
 
23 silverlight apps on windows phone 8.1
23   silverlight apps on windows phone 8.123   silverlight apps on windows phone 8.1
23 silverlight apps on windows phone 8.1
 
20 tooling and diagnostics
20   tooling and diagnostics20   tooling and diagnostics
20 tooling and diagnostics
 
19 programming sq lite on windows phone 8.1
19   programming sq lite on windows phone 8.119   programming sq lite on windows phone 8.1
19 programming sq lite on windows phone 8.1
 
17 camera, media, and audio in windows phone 8.1
17   camera, media, and audio in windows phone 8.117   camera, media, and audio in windows phone 8.1
17 camera, media, and audio in windows phone 8.1
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authentication
 
11 background tasks and multitasking
11   background tasks and multitasking11   background tasks and multitasking
11 background tasks and multitasking
 
08 localization and globalization in windows runtime apps
08   localization and globalization in windows runtime apps08   localization and globalization in windows runtime apps
08 localization and globalization in windows runtime apps
 
07 windows runtime app lifecycle
07   windows runtime app lifecycle07   windows runtime app lifecycle
07 windows runtime app lifecycle
 
05 programming page controls and page transitions animations
05   programming page controls and page transitions animations05   programming page controls and page transitions animations
05 programming page controls and page transitions animations
 
01 introducing the windows phone 8.1
01   introducing the windows phone 8.101   introducing the windows phone 8.1
01 introducing the windows phone 8.1
 
18 windows phone 8.1 for the enterprise developer
18   windows phone 8.1 for the enterprise developer18   windows phone 8.1 for the enterprise developer
18 windows phone 8.1 for the enterprise developer
 

Recently uploaded

Recently uploaded (20)

IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

12 maps, geolocation, and geofencing

  • 1. 30 April 2014 Building Apps for Windows Phone 8.1 Jump Start WinRT Apps & Silverlight
  • 2.
  • 3.
  • 4. // The URI to launch string uriToLaunch = @"bingmaps:?cp=51.501156~-0.141706&lvl=17"; var uri = new Uri(uriToLaunch); Windows.System.Launcher.LaunchUriAsync(uri);
  • 5. // 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);
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Location service Core logic CellWiFiGNSS Geofence core Geofencing WinRT API Geofences Microsoft Positioning Services Geocoordinate .NET API Geofence software tracking Geolocation WinRT API
  • 19.
  • 20. 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."; }
  • 21. 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; } }
  • 22.
  • 25.
  • 26.
  • 27.
  • 28. 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
  • 29. 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
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. ©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.