Unpacking Microsoft's universal apps strategy

Write an app for one Microsoft platform and it will (more or less) run on all other Microsoft platforms, including Windows Phone -- thanks in large part to Windows 10

box with packing peanuts home shopping ordering distribution box packaging shipping e commerce 0000

Application developers face more platform choices than ever these days. Even within the Microsoft world, the question persists: Should you target desktop or mobile?

That’s where Microsoft’s universal apps programming model comes in. The Windows 10 Technical Preview puts universal apps front and center, with the goal of running common code to all Microsoft platforms and stores: Windows phones, tablets, and PCs, as well as the Xbox One in the living room and the 80-inch Surface Hub on the office wall.

Universal apps are key to Microsoft’s reinvention of its Windows 8/WinRT programming model. Designed to move Windows application development away from the aging and overly complex Win32 APIs, WinRT introduced new, less complex APIs that owed more to Web programming models, along with a sandboxed runtime and a mix of XAML and HTML UI options.

As WinRT evolved with Windows 8 and as Windows Phone moved to the NT kernel, Microsoft began to add features to simplify the development of cross-platform applications. Portable Class Libraries allowed apps to share core business logic across platforms. Code needed to be built into libraries and was limited to the APIs it could call. Even so, it made it easier to share code between desktop and phone, as well as to Android, iOS, and Mac OS (thanks to support in Xamarin’s tools).

Windows 8.1 Update 1 brought the next stage in Microsoft’s cross-platform story: the first appearance of its universal apps model. Instead of being wrapped up as shareable libraries, universal apps could be built as Visual Studio projects – and delivered to both the Windows and Windows Phone stores. There was one drawback: While apps could share assets, they needed separate user experiences, and you had to build separate binaries for each Microsoft platform.

The Windows 8.1 model, according to Partner Director of Program Management Developer Platform Kevin Gallo, was “write once, tune everywhere,” similar to the Xamarin approach. Building apps using Xamarin’s tools meant creating core code that could be shared between platforms, then creating native user interfaces for each OS (and for phones and tablets). Similarly, universal apps could share some XAML code, but the real benefit for developers was a common API surface area for both phone and desktop.

As Gallo noted back in October 2014, “It’s up to the developer, for tuned experiences, for notifications, and for pricing. We’re giving flexibility, and the end user shouldn’t be able to tell the difference.” That meant that apps could be linked in the stores, so buying a copy in the Windows store let you download the phone version for free or for a discounted price. It’s certainly a popular approach for developers, with apps like the popular Windows Twitter client Tweetium adopting universal development to add Windows Phone versions.

The universal app strategy got a boost with the announcement of Windows 10. While it didn’t go into code-level details at either its September 2014 or January 2015 events, it was clear that universal apps would be the preferred application development model in the next Windows, and as analysis of the API in the Windows 10 Technical Previews showed, the underlying WinRT APIs were quickly catching up with Win32 – in some cases, offering more tools for working with new hardware and Windows features. More important, Windows 10 takes WinRT apps away from full screen and lets them run on the desktop, alongside familiar Win32 code.

Back in 2014, Gallo noted that Microsoft’s goals for universal apps in Windows 10 included “better automatic and adaptive layouts.” With new universal versions of Windows’ Mail, Contacts, and Calendar apps demonstrated at the company’s January Windows 10 event, it’s clear that Microsoft has gone a long way to delivering those goals, with common Windows and Windows Phone controls. That’s key to the next stage of the Windows Store evolution: a single store for all platforms and a single binary that can be delivered to all devices.

Microsoft has big ambitions for universal apps, intending to deliver a platform that scales from Internet of things devices like the Raspberry Pi to 80-inch wall screens. While it’s unlikely that any one app will scale across all platforms, it’s an approach that gives Microsoft a common programming model that will mean that developers won’t need to learn new tools and languages when switching from building apps for one class of device to another. If you’re building Windows applications, then it’s a good idea to start experimenting with universal apps and the latest WinRT APIs – so you’re ready for Windows 10 when it arrives later this year.

Copyright © 2015 IDG Communications, Inc.

How to choose a low-code development platform