<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>arsurya</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/arsurya/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/arsurya/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:47:17 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Four simple steps to create a Windows Universal App from Web App using Visual Studio 2015</title>
      <link>https://docs.microsoft.com/archive/blogs/arsurya/four-simple-steps-to-create-a-windows-universal-app-from-web-app-using-visual-studio-2015</link>
      <pubDate>Sun, 12 Jul 2015 06:03:00 GMT</pubDate>
      <dc:creator><![CDATA[Arun Kumar Surya Prakash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/arsurya/2015/07/12/four-simple-steps-to-create-a-windows-universal-app-from-web-app-using-visual-studio-2015/</guid>
      <description><![CDATA[Hi Everyone, in this post we will see how to create a windows universal app from existing web...]]></description>
      <content:encoded><![CDATA[<p>Hi Everyone, in this post we will see how to create a windows universal app from existing web application.</p>
<p>If you already have a web application, then you can create a windows universal app in just four steps. <em>You can read the same post over <a href="https://dailydotnettips.com/2015/07/14/creating-a-windows-universal-app-from-your-existing-web-sites-using-visual-studio-2015/">here </a>as well.&nbsp;</em></p>
<p><strong>Step 1</strong>: Open Visual Studio and Select <strong>File</strong> -&gt; <strong>New</strong> -&gt; <strong>Project</strong> and Select <strong>Blank App (Windows Universal)</strong> under &ldquo;<strong>JavaScript</strong> -&gt; <strong>Windows</strong> -&gt; <strong>Windows Universal</strong>&rdquo; templates.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/2654.webappvs.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/2654.webappvs.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/2654.webappvs.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/2654.webappvs.png" alt="" border="0" /></a></p>
<p><strong>Step 2</strong>: Once the project is loaded, it looks like the following, delete the <em>CSS</em>, <em>js</em>, <em>WinJS</em> and <em>default</em>.<em>html</em> files from the project.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/4442.vswebapp.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/4442.vswebapp.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/4442.vswebapp.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/4442.vswebapp.PNG" alt="" border="0" /></a></p>
<p>Now you are left with images folder and appxmanifest file.</p>
<p><strong>Step 3</strong>: Open the<strong> package.appxmanifest</strong> file</p>
<p>Search for <strong>StartPage=&rdquo;default.html&rdquo;</strong> and then remove the default.html and set the URL for which you are planned to create the universal app.</p>
<p>For example: I have choose this URL &ldquo;https://blogs.msdn.com/ &ldquo;.</p>
<p>Add the Application Content URI Rules to the package manifest. This setting defines the URL that are part of the app. If the URL is not defined in this rule then they will open in the default browse</p>
<p>Set the <strong>WindowsRuntimeAccess</strong> to <strong>all</strong>, so that the URL can use access the native platform API&rsquo;s.</p>
<p>(If you have more than one subdomain, you must use one wildcard for each subdomain)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/1778.visualstwebb.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/1778.visualstwebb.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/1778.visualstwebb.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/1778.visualstwebb.PNG" alt="" border="0" /></a></p>
<p><strong>Step 4</strong>: Press <strong>F5</strong> and run the app.</p>
<p>Now you have created a universal windows app from web app.</p>
<p>&nbsp;&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/3833.universalapp.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/3833.universalapp.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/3833.universalapp.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/3833.universalapp.PNG" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong>Advantage of using this Web Apps in Universal Windows Apps are:</strong></p>
<p>1. Integrate Cortana.</p>
<p>2. Add Live Tiles.</p>
<p>3. Add Toast Notifications to the Application.</p>
<p>4. In-App Purchase from Windows Store.</p>
<p>I hope this post would have helped in Creating Universal Windows App from existing Web Apps.</p>
<p>&nbsp;</p>
<p><strong>I have Published the same content over <a href="https://dailydotnettips.com/2015/07/14/creating-a-windows-universal-app-from-your-existing-web-sites-using-visual-studio-2015/">Creating a Windows Universal App from your existing Web Sites using Visual Studio 2015&nbsp;</a></strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Integrating Cortana in your Universal Windows App using Visual Studio 2015</title>
      <link>https://docs.microsoft.com/archive/blogs/arsurya/integrating-cortana-in-your-universal-windows-app-using-visual-studio-2015</link>
      <pubDate>Mon, 06 Jul 2015 03:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Arun Kumar Surya Prakash]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/arsurya/2015/07/06/integrating-cortana-in-your-universal-windows-app-using-visual-studio-2015/</guid>
      <description><![CDATA[Microsoft has introduced Cortana in 2014 Build Event. With just one year now Cortana has become one...]]></description>
      <content:encoded><![CDATA[<p>Microsoft has introduced Cortana in 2014 Build Event. With just one year now Cortana has become one of the best personal assistance. Initially using Cortana the user can activate systems commands, but now using Cortana the user can activate any applications either by foreground or background voice command. In this blogs let&rsquo;s see how to launch the universal windows app using Cortana.</p>
<p>Let&rsquo;s understand what is foreground and back ground voice commands, in foreground voice command the application will be launched by the Cortana. Where as in background voice command the Cortana activates the background task of the application and the results are populated in the Cortana&rsquo;s<br />Canvas.</p>
<p><strong>Foreground Voice Command Architecture</strong></p>
<p><br /> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/7612.cc.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/7612.cc.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/7612.cc.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/7612.cc.png" alt="" border="0" /></a></p>
<p>Step 1: VCD (Voice Command Definition) is an XML file which contains all the Commands to activate the app. When the app run by the user in the foreground, then the VCD file gets installed in the Cortana.</p>
<p>Step 2: User can use any command defined in the VCD file to launch the App.</p>
<p>Step 3, 4 ,5 6 : The speech spoken by the user is sent to Windows Speech platform and Microsoft Speech Recognition service in cloud, together they identify what the user has tried to said.</p>
<p>Step 7: Now Cortana receives the text said by the user and decides which application has to be launched and passes the recognized string to the application OnActivated event.</p>
<p><strong>To make this happen the three important steps </strong></p>
<ol>
<li>Create the voice commands in the VCD (Voice Command Definition) file</li>
<li>Then Register the VCD XML file on Application starts</li>
<li>Then handle the voice command on the App Activation</li>
</ol>
<p><strong>Creating the VCD (Voice Command Definition) file is the first and foremost step.</strong></p>
<p>Let&rsquo;s see what VCD file is and how to create commands.</p>
<p>Step 1: Add an XML file to the Solution and name it as VoiceCommandDefinition.xml</p>
<p>Step 2: Add CommandSet Element and specify the language the commands are targeted.</p>
<p>E.g &ldquo;en-us&rdquo; for English, this commandset language should match the language set in the user device.</p>
<p>Step 3: Add CommandPrefix to the CommandSet, which is nothing but the unique name you can provide to your application. This name is used as a prefix or suffix to the voice command to activate the app.<br /><br />E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;CommandPrefix&gt; Universal Messenger, &lt;/CommandPrefix&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Example&gt; Text Sam "Hello World" &lt;/Example&gt;</p>
<p>Step 4: Add a command to the CommandSet, and name it.</p>
<p>&nbsp;E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Command Name="showConversation"&gt;</p>
<p>Step 5: &nbsp;Add an example to the command which will be displayed in the Cortana canvas.</p>
<p>E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Example&gt; show my conversation with Sam &lt;/Example&gt;</p>
<p>Step 6: Add a ListenFor text, the text for which the Cortana listens. The&nbsp;<em>ListenFor</em>&nbsp;elements in the command phrases may contain optional words. These are wrapped in square brackets. User may include or may not include in there command.</p>
<p>E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ListenFor &gt; show [my] conversation with {user} &lt;/ListenFor&gt;</p>
<p>Step 7: Add the <strong>Feedback</strong>&nbsp;text which will be spoken by the&nbsp;<strong>Cortana</strong>&nbsp;when launching the app.</p>
<p>E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Feedback&gt; Showing conversation with {user} &lt;/Feedback&gt;</p>
<p>Step 8: And finally add navigate (this Element specified that the command is of Foreground activation)</p>
<p>E.g &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Navigate/&gt;</p>
<p>&nbsp;</p>
<p>An Sample VCD file commands are shown below..</p>
<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;</p>
<p>&lt;VoiceCommands xmlns="https://schemas.microsoft.com/voicecommands/1.2"&gt;</p>
<p>&nbsp; &lt;CommandSet xml:lang="en-us" Name="UniversalAppCommandSet_en-us"&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;CommandPrefix&gt; Universal Messenger, &lt;/CommandPrefix&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;Example&gt; Text Sam "Hello World" &lt;/Example&gt;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;Command Name="showConversation"&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Example&gt;&nbsp; show my conversation with sam&nbsp; &lt;/Example&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ListenFor &gt; show [my] conversation with {user} &lt;/ListenFor&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Feedback&gt; Showing conversation with {user} &lt;/Feedback&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Navigate/&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;/Command&gt;</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;PhraseList Label="user"&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Item&gt;Sam&lt;/Item&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Item&gt;John&lt;/Item&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;/PhraseList&gt;</p>
<p>&nbsp; &lt;/CommandSet&gt;</p>
<p>&lt;/VoiceCommands&gt;</p>
<p>&nbsp;</p>
<p>The Phraselist are the list of string which are used along with the commands.</p>
<p><strong>Now the VCD file is created and we can register the file to the Cortana.</strong></p>
<p>To Install the VCD file we need to use the <strong>InstallCommandDefinitionsFromStorageFileAsync </strong>Method takes the VCD file as Parameter and register it to the Cortana.</p>
<p>Add the following lines of code to the onLaunched method in App.xaml.cs, so the Cortana can resister and listen to the commands.</p>
<p>&nbsp;<span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">var</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;"> storageFile = </span></span><span style="color: blue; font-family: Consolas; font-size: 10pt;">await</span><span> Windows.Storage.</span><span><span><span>StorageFile</span></span></span><span><span>.GetFileFromApplicationUriAsync(</span></span><span><span><span>new</span></span></span><span><span><span>Uri</span></span></span><span><span>(</span></span><span><span><span>"ms-appx:///Sample.xml"</span></span></span><span><span>));</span></span></p>
<p><span style="color: blue; font-family: Consolas; font-size: 10pt;">await&nbsp;</span>Windows.ApplicationModel.VoiceCommands.<span><span><span style="color: #2b91af; font-family: Consolas; font-size: 10pt;"><span>VoiceCommandDefinitionManager</span></span></span><span><span>.InstallCommandDefinitionsFromStorageFileAsync(storageFile);</span></span></span></p>
<p>When the VCD file is installed in the Cortana, the user can see the Application name and an example text provided in the VCD file will&nbsp;appear in the Help Section of Cortana. Now the user is ready to go with voice&nbsp;command to activate the app.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/3731.C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/3731.C1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/3731.C1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/3731.C1.png" alt="" width="207" height="356" border="0" /></a></p>
<p>User Opens Cortana and says the voice command, the Cortana&nbsp;understands the commands said by the user and Activates the App.</p>
<p>In my sample application I have created voice command to&nbsp;how the conversation with some user. When I trigger the voice command the&nbsp;Cortana understands it and launch my application.</p>
<p>Till now we have created the VCD file and registered the VCD file o Cortana, but we haven&rsquo;t handled the on Activated event. But still we are able to open our app using the Command we defined in our VCD file. But we cannot do anything specific to the command.</p>
<p>When we invoke the command we will see Cortana displaying the application in the Canvas.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/0434.c2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/0434.c2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/0434.c2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/0434.c2.png" alt="" width="203" height="298" border="0" /></a></p>
<p><strong></strong>&nbsp;</p>
<p><strong>The Third and final step is to handle the Voice command in the Application OnActivated event.</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/1682.code2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/1682.code2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/71/92/1682.code2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-71-92/1682.code2.png" alt="" border="0" /></a></p>
<p>The IActivatedEventArgs has a property called Kind which specified the kind of activation is it. We can check if the application is launched using voiceCommand or by any other means, if the app is launched using voice command then we need to get the text spoken by the user, to get the string we need to cast the IActivatedEventArgs to VoiceCommandActivatedEventArgs.</p>
<p>The VoiceCommandActivatedEventArgs has a property called Result which will provide the SpeechRecognitionResult.</p>
<p>The SpeechRecognitionResult has a property called Text, which provides the Text Spoken by the user, Then using this text we can decide which page has to be displayed.</p>
<p>That&rsquo;s our Application is integrated with the Cortana. We can launch our app using the voice commands.<br />In my next blog let&rsquo;s see how to integrate the Cortana to the background task.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/62/59/18/UniversalMessanger.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-62-59-18/UniversalMessanger.zip">UniversalMessanger.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>