MS Champs meetup may 2014 on Cortana.
-
Upload
isham-mohamed-iqbal -
Category
Technology
-
view
334 -
download
2
Transcript of MS Champs meetup may 2014 on Cortana.
![Page 1: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/1.jpg)
Thanks all for voting
#StopDengue
![Page 2: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/2.jpg)
![Page 3: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/3.jpg)
We all know about Cortana
She does•Call Hubby, mobile
•Text Hubby hi sweety
•Change my 3 pm appointment to 4
•Next time I’m at the Microsoft, remind me to
meet Wela
•Take note: left my car on level 4
•Wake up me in 20 minutes
•Play Hariharan
•Find cheap pizza restaurant near me
•Do I need an umbrella
![Page 4: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/4.jpg)
“Take note: left my car on level 4”
Where does the note go?
![Page 5: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/5.jpg)
Boooorrrrring !!
Old stories
ENOUGH!
![Page 6: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/6.jpg)
OK...!Lets
HACK
![Page 7: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/7.jpg)
The <big>IDEA</big>
Everyone knows
Only hackers know
![Page 8: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/8.jpg)
Confusing?
![Page 9: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/9.jpg)
EXAMPLE scenario
Me : Set colour to RedCortana : Setting colour to Red[Win 8 & WP apps shows Red colour background]
Me : Set colour to BlueCortana : Settings colour to Blue[Win 8 & WP apps shows Red colour background]
![Page 10: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/10.jpg)
REAL LIFE scenarioMe : Switch on bulb 1Cortana : Switching bulb 1 on[One bulb in the room gets light]
Me : Switch off bulb 1Cortana : Switching bulb 1 off[One bulb in the room gets off from light]
Me : Switch off bulb 1Cortana : YAKO!! Its already off
![Page 11: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/11.jpg)
Real life IDEA
![Page 12: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/12.jpg)
Fly balloons with CORTANA
![Page 13: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/13.jpg)
Lets
/build//
![Page 14: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/14.jpg)
/build//
Voice Command
![Page 15: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/15.jpg)
Easy
3 steps
![Page 16: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/16.jpg)
Create Voice Command Definition(s)
Register VCD XML on App Startup
Handle Voice Command Activation
![Page 17: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/17.jpg)
Refer:http://channel9.msdn.com/Events/Build/2014/2-530
![Page 18: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/18.jpg)
<?xml version="1.0" encoding="utf-8"?><VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en-us" Name="englishCommands"> <CommandPrefix>MSDN</CommandPrefix> <Example>How do I add Voice Commands to my application</Example> <Command Name="FindText"> <Example>Find Install Voice Command Sets</Example> <ListenFor>Search</ListenFor> <ListenFor>Search for {dictatedSearchTerms}</ListenFor> <ListenFor>Find</ListenFor> <ListenFor>Find {dictatedSearchTerms}</ListenFor> <Feedback>Search on MSDN</Feedback> <Navigate Target="MainPage.xaml" /> </Command> <Command Name="nlpCommand"> <Example>How do I add Voice Commands to my application</Example> <ListenFor>{dictatedVoiceCommandText}</ListenFor> <Feedback>Starting MSDN...</Feedback> <Navigate Target="MainPage.xaml" /> </Command> <PhraseTopic Label="dictatedVoiceCommandText" Scenario="Dictation"> <Subject>MSDN</Subject> </PhraseTopic> <PhraseTopic Label="dictatedSearchTerms" Scenario="Search"> <Subject>MSDN</Subject> </PhraseTopic> </CommandSet> </VoiceCommands>
![Page 19: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/19.jpg)
private async void RegisterVoiceCommands(){ // SHOULD BE PERFORMED UNDER TRY/CATCH Uri uriVoiceCommands = new Uri("ms-appx:///vcd.xml", UriKind.Absolute)); await VoiceCommandService.InstallCommandSetsFromFileAsync(uriVoiceCommands);
// Please note that VoiceCommandService ends with WP8.1 (End of Silverlight era) // (ie) No more .xap’s after WP8.1. Only .appx’s}
Windows Phone Silverlight Apps on Windows Phone 8.1
Windows Runtime Apps on Windows Phone 8.1
private async void RegisterVoiceCommands(){ // SHOULD BE PERFORMED UNDER TRY/CATCH Uri uriVoiceCommands = new Uri("ms-appx:///vcd.xml", UriKind.Absolute); StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uriVoiceCommands); await VoiceCommandManager.InstallCommandSetsFromStorageFileAsync(file); // No need to define Capabilities in app manifest}
![Page 20: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/20.jpg)
VCD Commands and Targets
YourPage.xamlSYSTEM
Silverlight App
System launches app on page specified by Target
Page code maps commands (intents) into actions
![Page 21: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/21.jpg)
// Windows Phone Silverlight App, in MainPage.xaml.cs
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e){ base.OnNavigatedTo(e);
if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { string recoText = null; // What did the user say? e.g. MSDN, "Find Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("reco", out recoText);
string voiceCommandName = null; // Which command was recognized in the VCD.XML file? e.g. "FindText" NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName);
string searchTerms = null; // What did the user say, for named phrase topic or list "slots"? e.g. "Windows Phone Voice Commands" NavigationContext.QueryString.TryGetValue("dictatedSearchTerms", out searchTerms);
switch (voiceCommandName) // What command launched the app? { case "FindText": HandleFindText(searchTerms); break;
case "nlpCommand": HandleNlpCommand(recoText); break; } }}
![Page 22: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/22.jpg)
VCD Commands and Targets
SYSTEMApp class
YourPage.xaml
Windows Runtime App
System tells code in App class what command and target were used
Code in App class navigates to page
Page code maps commands (intents) into actions
![Page 23: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/23.jpg)
// Windows Runtime App on Windows Phone 8.1, inside OnActivated override in App class
if (args.Kind == ActivationKind.VoiceCommand){ VoiceCommandActivatedEventArgs vcArgs = (VoiceCommandActivatedEventArgs)args;
string voiceCommandName = vcArgs.Result.RulePath.First(); // What command launched the app?
switch (voiceCommandName) // Navigate to right page for the voice command { case "FindText": // User said "find" or "search" rootFrame.Navigate(typeof(MSDN.FindText), vcArgs.Result); break;
case "nlpCommand": // User said something else rootFrame.Navigate(typeof(MSDN.NlpCommand), vcArgs.Result); break; }}
![Page 24: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/24.jpg)
/build//
Bluetoothpairing
![Page 25: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/25.jpg)
Refer :http://blogs.msdn.com/b/flecoqui/archive/2013/12/13/windows-store-and-windows-phone-app-to-app-communication-over-bluetooth.aspx
![Page 26: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/26.jpg)
“Cortana, recharge mom’s
mobile with 50 rupees”
![Page 27: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/27.jpg)
Good exampleDialog eWallet
![Page 28: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/28.jpg)
eZ charging API - Charge the cost of digital goods
eZ Cash API - transfer funds between two eZ Cash wallets and check
the transaction history.
![Page 29: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/29.jpg)
http://1drv.ms/RucQqc
![Page 30: MS Champs meetup may 2014 on Cortana.](https://reader037.fdocuments.in/reader037/viewer/2022103116/55893ec8d8b42ac75b8b45a9/html5/thumbnails/30.jpg)
http://1drv.ms/RucQqc