Microsoft Opens Windows to the Universal App: One App for All Platforms
Today at the opening day of Microsoft’s Build developer conference the company formally announced Universal Windows apps. These apps will run across the Windows family of devices: phone, tablet, and desktop PC. The upcoming release of Windows Phone 8.1 will align that platform with the existing Windows 8.1 platform that exists for desktops and tablets. This change means that developers can write a single app that will run unmodified on all of these platforms. Developers will retain the ability to customize the app behavior and appearance for each environment if they desire.
During the keynote, Microsoft Director Kevin Gallo demonstrated this new binary by taking an existing Windows 8.1 app in Visual Studio and then added Windows Phone 8.1 compatibility in a straightforward manner. Under the existing solution, nodes appear in Visual Studio’s Solution Explorer for the original Windows 8.1 target and the newly added Windows Phone 8.1 target. A third node exists for code common to both platforms. Developers can control which portions of the code are stored in this common code, and which is stored in a platform specific manner. One advantage of this approach is that app logic can be stored in the common area to be shared by both platforms, while still allowing developers to add device specific functionality—be it keyboards and mice or the presence of GPS information on phones.
Under the hood, universal apps are running on the Windows Runtime, which was originally introduced with Windows 8. NuGet packages installed for a particular platform are by default associated with that platform, but developers have the option to reuse it for the newly added targets. For an example, Gallo demonstrated how JSON.NET was part of the Windows 8.1 app, and then easily added to the Windows Phone 8.1 target when that target was added to the solution.
InfoQ is covering the Build 2014 Conference first hand and will continue to provide updates on this and all news that emerges—stay tuned.
Anatole Tresch Mar 03, 2015