SlideShare una empresa de Scribd logo
1 de 57
Windows Phone 8 Sensors




David Isbitski
Technical Evangelist, Microsoft
http://blogs.msdn.com/davedev
@TheDaveDev
Windows Phone 8 Sensors
Windows Phone 8 Sensors
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracyInMeters = 50;
Geoposition myLocation = await
geolocator.GetGeopositionAsync(maximumAge, timeout);

// We need to convert the Geoposition to a GeoCoordinate to show it on the map
GeoCoordinate geoCord = new
GeoCoordinate(myLocation.Coordinate.Latitude, myLocation.Coordinate.Longitude);
MyMapControl.Center = geoCord;

// Set up an event handler to watch for location updates
geolocator.PositionChanged += updatePosition;
void newPosition(Geolocator sender, PositionChangedEventArgs args)
{
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    {
        GeoCoordinate geoCord =
            new GeoCoordinate(args.Position.Coordinate.Latitude,
                                args.Position.Coordinate.Longitude);
        MyMapControl.Center = geoCord;
    });
}
<Grid x:Name="ContentPanel" >
      <maps:Map x:Name="MyMap"/>
</Grid>



private void CreateMap()
 {
     Map MyMap = new Map();
     ContentPanel.Children.Add(MyMap);
 }
MapDownloaderTask mdt = new MapDownloaderTask();
mdt.Show();
ProximityDevice device = ProximityDevice.GetDefault();

// Make sure NFC is supported
if (device != null)
{
    _device.DeviceArrived += device_DeviceArrived;
    _device.SubscribeForMessage(“StringMessage", StringMessageHandler);
    _device.SubscribeForMessage(“ByteMessage", ByteMessageHandler);

    PeerFinder.Start();
}
void device_DeviceArrived(ProximityDevice sender)
{
    if (sendingString)
    {
        sender.PublishMessage("MyStringMessage", someString);
    }
    else if (sendingBytes)
    {
        var messageWriter = new DataWriter();
        messageWriter.UnicodeEncoding = UnicodeEncoding.Utf16LE;
        messageWriter.WriteBytes(someBytes);
        sender.PublishBinaryMessage("MyBinaryMessage",
          messageWriter.DetachBuffer());
    }
}
private void StringMessageHandler(ProximityDevice
sender, ProximityMessage message)
{
    string messageRecieved = message.DataAsString;
}
private void ByteMessageHandler(ProximityDevice sender, ProximityMessage
message)
{
    byte[] messageBytes;
    using (DataReader dReader = DataReader.FromBuffer(message.Data))
    {
         messageBytes = new byte[dReader.UnconsumedBufferLength];
         dReader.ReadBytes(messageBytes);
    }
}
ProximityDevice device = ProximityDevice.GetDefault();

// Make sure NFC is supported
if (device != null)
{
    PeerFinder.TriggeredConnectionStateChanged +=
OnTriggeredConnectionStateChanged;
    // Start finding peer apps, while making app discoverable by peers
    PeerFinder.Start();
}
void OnTriggeredConnectionStateChanged(object sender,
                                       TriggeredConnectionStateChangedEventArgs args) {
    switch (args.State)    {
        case TriggeredConnectState.Listening: // Connecting as host
            break;
        case TriggeredConnectState.PeerFound: // Proximity gesture is complete – setting up link
            break;
        case TriggeredConnectState.Connecting: // Connecting as a client
            break;
        case TriggeredConnectState.Completed: // Connection completed, get the socket
            streamSocket = args.Socket;
            break;
        case TriggeredConnectState.Canceled: // ongoing connection canceled
            break;
        case TriggeredConnectState.Failed:    // Connection was unsuccessful
            break;
    }
}
PeerFinder.AllowBluetooth = true;
PeerFinder.AllowInfrastructure = true;
async void CheeseLiker()
{
    SpeechSynthesizer synth = new SpeechSynthesizer();

    await synth.SpeakTextAsync("I like cheese.");
}
foreach (VoiceInformation vi in InstalledVoices.All)
{
    if (vi.Language == "de-DE")
    {
        _speechSynth = new SpeechSynthesizer();
        _speechSynth.SetVoice(vi);
    }
}
SpeechRecognizerUI recoWithUI;

async private void ListenButton_Click(object sender, RoutedEventArgs e)
{
    this.recoWithUI = new SpeechRecognizerUI();

    SpeechRecognitionUIResult recoResult =
        await recoWithUI.RecognizeWithUIAsync();
    if ( recoResult.ResultStatus == SpeechRecognitionUIStatus.Succeeded )
        MessageBox.Show(string.Format("You said {0}.",
                                       recoResult.RecognitionResult.Text));
}
foreach(SpeechRecognizerInformation sri
        in InstalledSpeechRecognizers.All)
{
    if(sri.Language == "de-DE")
        _speechRecognizer.Recognizer.SetRecognizer(sri);
}
Windows Phone 8
Sensors: Speech APIs
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
<CommandPrefix> Fortune Teller </CommandPrefix>
<Example> Will I find money </Example>
<Command Name="showMoney">
  <Example> Will I find money </Example>
  <ListenFor> [Will I find] {futureMoney} </ListenFor>
  <Feedback> Showing {futureMoney} </Feedback>
  <Navigate Target="/money.xaml"/>
</Command>
<PhraseList Label="futureMoney">
  <Item> money </Item>
  <Item> riches </Item>
  <Item> gold </Item>
</PhraseList>
/Money.xaml/?voiceCommandName=showMoney&futureMoney
=gold&reco=Fortune%20Teller%Will%20I%20find%20gold"
Windows Phone 8 Sensors




David Isbitski
Technical Evangelist, Microsoft
http://blogs.msdn.com/davedev
@TheDaveDev
Windows Phone 8 Sensors

Más contenido relacionado

La actualidad más candente

History of jQuery
History of jQueryHistory of jQuery
History of jQueryjeresig
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightDonny Wals
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"LogeekNightUkraine
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboardsDenis Ristic
 
Writing Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassWriting Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassJean-Luc David
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureGarann Means
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections modulePablo Enfedaque
 
Lecture8 php page control by okello erick
Lecture8 php page control by okello erickLecture8 php page control by okello erick
Lecture8 php page control by okello erickokelloerick
 
Service intergration
Service intergration Service intergration
Service intergration 재민 장
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday DeveloperRoss Tuck
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"LogeekNightUkraine
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Angular Restmod (english version)
Angular Restmod (english version)Angular Restmod (english version)
Angular Restmod (english version)Marcin Gajda
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMJonathan Wage
 

La actualidad más candente (20)

History of jQuery
History of jQueryHistory of jQuery
History of jQuery
 
Everyday's JS
Everyday's JSEveryday's JS
Everyday's JS
 
Coding website
Coding websiteCoding website
Coding website
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
 
Writing Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassWriting Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google Glass
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer Architecture
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections module
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Lecture8 php page control by okello erick
Lecture8 php page control by okello erickLecture8 php page control by okello erick
Lecture8 php page control by okello erick
 
Service intergration
Service intergration Service intergration
Service intergration
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
Deferred
DeferredDeferred
Deferred
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Angular Restmod (english version)
Angular Restmod (english version)Angular Restmod (english version)
Angular Restmod (english version)
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 

Destacado

Social Sponsorships: Rethinking Sponsorships in the Age of Social Media
Social Sponsorships: Rethinking Sponsorships in the Age of Social MediaSocial Sponsorships: Rethinking Sponsorships in the Age of Social Media
Social Sponsorships: Rethinking Sponsorships in the Age of Social MediaSuzanne Carawan
 
9 мая
9 мая9 мая
9 маяYanina
 
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...Suzanne Carawan
 
РЖД
РЖДРЖД
РЖДYanina
 
5 Words You Never Want to Hear "You didn't have a back-up?!"
5 Words You Never Want to Hear "You didn't have a back-up?!"5 Words You Never Want to Hear "You didn't have a back-up?!"
5 Words You Never Want to Hear "You didn't have a back-up?!"Charlie Havens
 
Масленица
МасленицаМасленица
МасленицаYanina
 

Destacado (6)

Social Sponsorships: Rethinking Sponsorships in the Age of Social Media
Social Sponsorships: Rethinking Sponsorships in the Age of Social MediaSocial Sponsorships: Rethinking Sponsorships in the Age of Social Media
Social Sponsorships: Rethinking Sponsorships in the Age of Social Media
 
9 мая
9 мая9 мая
9 мая
 
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...
etouches Presents Moving from Mission-Based to Revenue-Generating Social Netw...
 
РЖД
РЖДРЖД
РЖД
 
5 Words You Never Want to Hear "You didn't have a back-up?!"
5 Words You Never Want to Hear "You didn't have a back-up?!"5 Words You Never Want to Hear "You didn't have a back-up?!"
5 Words You Never Want to Hear "You didn't have a back-up?!"
 
Масленица
МасленицаМасленица
Масленица
 

Similar a Windows Phone 8 Sensors

Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsYakov Fain
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it meansRobert Nyman
 
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019DevClub_lv
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websocketsWim Godden
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authenticationWindowsPhoneRocks
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015Fernando Daciuk
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Droidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfDroidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfAnvith Bhat
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps OfflinePedro Morais
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intentadmin220812
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 

Similar a Windows Phone 8 Sensors (20)

Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
Nevermore Unit Testing
Nevermore Unit TestingNevermore Unit Testing
Nevermore Unit Testing
 
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019Managing State in React Apps with RxJS by James Wright at FrontCon 2019
Managing State in React Apps with RxJS by James Wright at FrontCon 2019
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
OWASP Proxy
OWASP ProxyOWASP Proxy
OWASP Proxy
 
Rhino Mocks
Rhino MocksRhino Mocks
Rhino Mocks
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websockets
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authentication
 
Android wearpp
Android wearppAndroid wearpp
Android wearpp
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Droidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfDroidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdf
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Pushing the Web: Interesting things to Know
Pushing the Web: Interesting things to KnowPushing the Web: Interesting things to Know
Pushing the Web: Interesting things to Know
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 

Más de David Isbitski

Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015David Isbitski
 
Lap Around Azure Build Updates
Lap Around Azure Build UpdatesLap Around Azure Build Updates
Lap Around Azure Build UpdatesDavid Isbitski
 
Hosting a WordPress Blog on Azure Websites
Hosting a WordPress Blog on Azure WebsitesHosting a WordPress Blog on Azure Websites
Hosting a WordPress Blog on Azure WebsitesDavid Isbitski
 
Azure Mobile Services for iOS
Azure Mobile Services for iOSAzure Mobile Services for iOS
Azure Mobile Services for iOSDavid Isbitski
 
Building Apps for the new Windows Store
Building Apps for the new Windows Store Building Apps for the new Windows Store
Building Apps for the new Windows Store David Isbitski
 
Designing for Windows Phone 8
Designing for Windows Phone 8Designing for Windows Phone 8
Designing for Windows Phone 8David Isbitski
 
A Developer Lap Around Windows Phone 8
A Developer Lap Around Windows Phone 8 A Developer Lap Around Windows Phone 8
A Developer Lap Around Windows Phone 8 David Isbitski
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesDavid Isbitski
 
Windows Store Apps with HTML and JavaScript
Windows Store Apps with HTML and JavaScriptWindows Store Apps with HTML and JavaScript
Windows Store Apps with HTML and JavaScriptDavid Isbitski
 
Designing a Windows Store App
Designing a Windows Store AppDesigning a Windows Store App
Designing a Windows Store AppDavid Isbitski
 
Playing music and sound effects in a windows 8 metro style app using html5 an...
Playing music and sound effects in a windows 8 metro style app using html5 an...Playing music and sound effects in a windows 8 metro style app using html5 an...
Playing music and sound effects in a windows 8 metro style app using html5 an...David Isbitski
 
Windows Phone App Development
Windows Phone App DevelopmentWindows Phone App Development
Windows Phone App DevelopmentDavid Isbitski
 
HTML5 Graphics - Canvas and SVG
HTML5 Graphics - Canvas and SVGHTML5 Graphics - Canvas and SVG
HTML5 Graphics - Canvas and SVGDavid Isbitski
 
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!David Isbitski
 
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptBuilding Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptDavid Isbitski
 

Más de David Isbitski (17)

Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015
 
Lap Around Azure Build Updates
Lap Around Azure Build UpdatesLap Around Azure Build Updates
Lap Around Azure Build Updates
 
Hosting a WordPress Blog on Azure Websites
Hosting a WordPress Blog on Azure WebsitesHosting a WordPress Blog on Azure Websites
Hosting a WordPress Blog on Azure Websites
 
Azure Mobile Services for iOS
Azure Mobile Services for iOSAzure Mobile Services for iOS
Azure Mobile Services for iOS
 
Building Apps for the new Windows Store
Building Apps for the new Windows Store Building Apps for the new Windows Store
Building Apps for the new Windows Store
 
More Than An App
More Than An AppMore Than An App
More Than An App
 
Designing for Windows Phone 8
Designing for Windows Phone 8Designing for Windows Phone 8
Designing for Windows Phone 8
 
A Developer Lap Around Windows Phone 8
A Developer Lap Around Windows Phone 8 A Developer Lap Around Windows Phone 8
A Developer Lap Around Windows Phone 8
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Windows Store Apps with HTML and JavaScript
Windows Store Apps with HTML and JavaScriptWindows Store Apps with HTML and JavaScript
Windows Store Apps with HTML and JavaScript
 
Designing a Windows Store App
Designing a Windows Store AppDesigning a Windows Store App
Designing a Windows Store App
 
Playing music and sound effects in a windows 8 metro style app using html5 an...
Playing music and sound effects in a windows 8 metro style app using html5 an...Playing music and sound effects in a windows 8 metro style app using html5 an...
Playing music and sound effects in a windows 8 metro style app using html5 an...
 
Windows Phone App Development
Windows Phone App DevelopmentWindows Phone App Development
Windows Phone App Development
 
HTML5 Graphics - Canvas and SVG
HTML5 Graphics - Canvas and SVGHTML5 Graphics - Canvas and SVG
HTML5 Graphics - Canvas and SVG
 
HTML5 Gaming
HTML5 GamingHTML5 Gaming
HTML5 Gaming
 
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
 
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScriptBuilding Windows 8 Metro Style casual games using HTML5 and JavaScript
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Windows Phone 8 Sensors

  • 1. Windows Phone 8 Sensors David Isbitski Technical Evangelist, Microsoft http://blogs.msdn.com/davedev @TheDaveDev
  • 2.
  • 3. Windows Phone 8 Sensors
  • 4. Windows Phone 8 Sensors
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Geolocator geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 50; Geoposition myLocation = await geolocator.GetGeopositionAsync(maximumAge, timeout); // We need to convert the Geoposition to a GeoCoordinate to show it on the map GeoCoordinate geoCord = new GeoCoordinate(myLocation.Coordinate.Latitude, myLocation.Coordinate.Longitude); MyMapControl.Center = geoCord; // Set up an event handler to watch for location updates geolocator.PositionChanged += updatePosition;
  • 10. void newPosition(Geolocator sender, PositionChangedEventArgs args) { Deployment.Current.Dispatcher.BeginInvoke(() => { GeoCoordinate geoCord = new GeoCoordinate(args.Position.Coordinate.Latitude, args.Position.Coordinate.Longitude); MyMapControl.Center = geoCord; }); }
  • 11.
  • 12. <Grid x:Name="ContentPanel" > <maps:Map x:Name="MyMap"/> </Grid> private void CreateMap() { Map MyMap = new Map(); ContentPanel.Children.Add(MyMap); }
  • 13.
  • 14. MapDownloaderTask mdt = new MapDownloaderTask(); mdt.Show();
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. ProximityDevice device = ProximityDevice.GetDefault(); // Make sure NFC is supported if (device != null) { _device.DeviceArrived += device_DeviceArrived; _device.SubscribeForMessage(“StringMessage", StringMessageHandler); _device.SubscribeForMessage(“ByteMessage", ByteMessageHandler); PeerFinder.Start(); }
  • 22. void device_DeviceArrived(ProximityDevice sender) { if (sendingString) { sender.PublishMessage("MyStringMessage", someString); } else if (sendingBytes) { var messageWriter = new DataWriter(); messageWriter.UnicodeEncoding = UnicodeEncoding.Utf16LE; messageWriter.WriteBytes(someBytes); sender.PublishBinaryMessage("MyBinaryMessage", messageWriter.DetachBuffer()); } }
  • 23. private void StringMessageHandler(ProximityDevice sender, ProximityMessage message) { string messageRecieved = message.DataAsString; }
  • 24. private void ByteMessageHandler(ProximityDevice sender, ProximityMessage message) { byte[] messageBytes; using (DataReader dReader = DataReader.FromBuffer(message.Data)) { messageBytes = new byte[dReader.UnconsumedBufferLength]; dReader.ReadBytes(messageBytes); } }
  • 25.
  • 26. ProximityDevice device = ProximityDevice.GetDefault(); // Make sure NFC is supported if (device != null) { PeerFinder.TriggeredConnectionStateChanged += OnTriggeredConnectionStateChanged; // Start finding peer apps, while making app discoverable by peers PeerFinder.Start(); }
  • 27. void OnTriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs args) { switch (args.State) { case TriggeredConnectState.Listening: // Connecting as host break; case TriggeredConnectState.PeerFound: // Proximity gesture is complete – setting up link break; case TriggeredConnectState.Connecting: // Connecting as a client break; case TriggeredConnectState.Completed: // Connection completed, get the socket streamSocket = args.Socket; break; case TriggeredConnectState.Canceled: // ongoing connection canceled break; case TriggeredConnectState.Failed: // Connection was unsuccessful break; } }
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. async void CheeseLiker() { SpeechSynthesizer synth = new SpeechSynthesizer(); await synth.SpeakTextAsync("I like cheese."); }
  • 37. foreach (VoiceInformation vi in InstalledVoices.All) { if (vi.Language == "de-DE") { _speechSynth = new SpeechSynthesizer(); _speechSynth.SetVoice(vi); } }
  • 38.
  • 39. SpeechRecognizerUI recoWithUI; async private void ListenButton_Click(object sender, RoutedEventArgs e) { this.recoWithUI = new SpeechRecognizerUI(); SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync(); if ( recoResult.ResultStatus == SpeechRecognitionUIStatus.Succeeded ) MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text)); }
  • 40. foreach(SpeechRecognizerInformation sri in InstalledSpeechRecognizers.All) { if(sri.Language == "de-DE") _speechRecognizer.Recognizer.SetRecognizer(sri); }
  • 42.
  • 43.
  • 44. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 45. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 46. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 47. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 48. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 49. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 50. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 51. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 52. <CommandPrefix> Fortune Teller </CommandPrefix> <Example> Will I find money </Example> <Command Name="showMoney"> <Example> Will I find money </Example> <ListenFor> [Will I find] {futureMoney} </ListenFor> <Feedback> Showing {futureMoney} </Feedback> <Navigate Target="/money.xaml"/> </Command> <PhraseList Label="futureMoney"> <Item> money </Item> <Item> riches </Item> <Item> gold </Item> </PhraseList>
  • 54.
  • 55.
  • 56. Windows Phone 8 Sensors David Isbitski Technical Evangelist, Microsoft http://blogs.msdn.com/davedev @TheDaveDev