SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

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

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines 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
 
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
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines 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
 
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
 

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