First Look at Windows and Windows Phone 8.1 Universal Apps with Visual Studio 2013 Update 2 RC

By in , ,
No comments

Although I didn’t have the honor of attending Build this year (someday!!), I thought I’d do the next best thing and grab the latest bits and get my feet wet with the new Universal apps for Windows and Windows Phone, available with the newly released Visual Studio Update 2 RC. The installer ran without a hitch, and after a quick reboot I was up and running, though as far as I can tell nothing significant in the UI has changed. I was worried I would first need to install the Windows 8.1 Update as well, but apparently this is either not required, or if it is required, skipping it doesn’t seem to impede the usability or functionality of the VS update (so far). Adding a new project reveals several new templates, but at first I was a bit confused where to look to find the Universal Apps, as the Windows Phone section appeared to only have the Telerik templates… Looking under Windows Store, however you’ll find not only the global Universal App template, but also separate templates for Windows Store and another section for Windows Phone. This makes sense, since the Store is eventually going to support both platforms, and I can only imagine that the Telerik templates will eventually be updated to be listed in these sections in a future release.

Hello, Universe!

So like any first app, I thought I’d start with a “Hello, World” type application, appropriately named “HelloUniverse”, targeting both platforms. As you can see, in addition to the separate projects for each platform, the Universal App template also generates a third “Shared” project which contains all the global data, logic and assets to be shared across the Apps. Running the project from here launches the Windows version, which I was surprised ran without a hitch on my not-yet-updated Windows 8.1 machine: This makes me wonder if these apps will actually run on Windows 8.1 machines, or if this is just something I can do because I’m running within Visual Studio (anybody know the answer to this?). I then fired up the Windows Phone version, which also launched without a hitch in the new Windows Phone 8.1 simulator. As you can see this version looks a bit nicer, since it includes it’s own separate set of assets, revealing just how much you can tailor the experience for each platform. So as one final test (and so I can feel like I’ve actually DONE something!) I thought I’d see just how easy it is to modify the global shared project, and have those changes propagate and be made available to the separate applications. First, I added the following global resource to the App.xaml:

<Application x:Class="HelloUniverse.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:HelloUniverse"> <Application.Resources> <x:String x:Key="AppName">Hello, Universe!</x:String> </Application.Resources> </Application>

Next I went into each project and added a binding to this new resource: However, although the binding appears to work in the designer of each app: launching the app kept showing the original “application name” header text for each platform. At first, since this is an RC, I thought this might be a possible bug, but didn’t think such an obvious error could be missed… So I dug a bit deeper and found that in the Shared project under the Strings folder is a file called Resources.resw which appears to be a new (at least to me) format for storing resources that I assume will be shared across platforms. Within this resource file are several string values, including one named “Hub.Header” and another named “Header.Text”, which, looking at the XAML definitions for each Hub in the two projects, match up with the new (again, at least to me) Uid property: It appears that, through this property, Windows is automatically wiring up the binding to that resource file. Again, I’m not at Build (sad face) so I don’t know if this is new, or if it’s always been here and I’ve never used it. Either way, I think it’s pretty darn cool, though definitely confusing if you’re not expecting it! At any rate, to test my theory, I simply removed the resources, and sure enough, re-launching both apps now shows my new shared resource header!  

What’s Next

I can barely contain my excitement over this new iteration of Windows and especially for the changes and updates in development. I can’t wait to dive in and see just how powerful the new Universal Apps are for delivering a true cross-platform experience. And don’t even get me STARTED on the Xbox One support! Given just how much awesome is being released out there this week, maybe it’s a good thing I’m not there, because by now I think I’d probably have passed out from amazement… No, of course I’m kidding! Next time, no excuses: SEE YOU NEXT YEAR AT BUILD!!!

The following two tabs change content below.

selaromdotnet

Senior Developer at iD Tech
Josh loves all things Microsoft and Windows, and develops solutions for Web, Desktop and Mobile using the .NET Framework, Azure, UWP and everything else in the Microsoft Stack. His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom. His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.