SlideShare uma empresa 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
WP8 Sensors Guide Speech APIs

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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?!"
 
Масленица
МасленицаМасленица
Масленица
 

Semelhante a WP8 Sensors Guide Speech APIs

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
 

Semelhante a WP8 Sensors Guide Speech APIs (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
 

Mais 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
 

Mais 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

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

WP8 Sensors Guide Speech APIs

  • 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