Universal Apps is the Future of Windows Development

Microsoft's new app development model is at the heart of Windows 10. What is it, and more importantly, what do developers think of it?

Universal Studios Neon

Universal Studios Logo Neon Night Shot ~ Universal Studios ~ Hollywood, California

Credit: Prayitno Photography Flickr CC licensed image.

We've called them Metro apps, then when a lawsuit meant that Microsoft couldn't use the name, we called them Modern or Windows Store apps. But now they've finally got a new official name, and it looks like it's one that's going to stick. Let's give a big welcome, then, to the Universal app. They're going to be big. That's because, as Terry Myerson and Joe Belfiore made very clear at the Windows 190 unveiling, with the expansion of WinRT APIs and support for windowed WinRT apps on the desktop, Universal apps are the future of Windows development.

First revealed in April at Build 2014, the initial iteration of the Universal app allows developers to share code between Windows 8.1 and Windows Phone 8.1. The Universal app model builds on the common core that Microsoft has developed for its main operating systems, and is more flexible than its original code-sharing technology, Portable Class Libraries. It's proved popular with developers working across phones and tablets, but with the release of Windows 10 Universal apps are set to be the preferred way of building Windows apps - from Internet of Things to phones to tablets to desktops to games consoles to wall displays.

The heart of the Universal app model is simple: write your core code once and then give it an appropriate user interface. It's been clear for years that the "write once, run everywhere" model just doesn't work. We may want to use the same app functionality on a PC as we would on a phone or on a tablet, but we want to use that app very differently on each device. That means a different user experience, and very different interaction models.

Where the Universal model gets interesting is in its cross-platform support. You're not limited to working with Microsoft operating systems thanks to Xamarin's support for Universal projects in its tools, particularly its Visual Studio plug-ins. Thanks to Xamarin you can use your Universal libraries and code in iOS, MacOS, and Android apps - letting you tune user experiences for a much wider range of end users.

Another aspect of Microsoft's Universal app story is its store, which gives developers one place to upload and sell apps. While there's some confusion around the difference between Universal and Linked apps, it really shouldn't make any difference to end users (if at all). Where Universal apps share code, and can be sold on either or both Windows and Windows Phone, Linked apps are treated as one for billing purposes, but don't have to have common code (though they can share back end services to pass information between devices).

So a game like Halo: Spartan Assault is a linked app, with different versions on Xbox, on Windows 8.1, and on Windows Phone, all sharing scores and achievements through Xbox Live. Linked apps are able to bundle pricing; so if you have the Windows Phone version of a linked app, there's the option of a special price for the Windows 8.1 version, or even of a single bundle that lets you download both versions for one price. It's all up to the developer; the end user won't know the difference between Universal and Linked apps.

I recently sat down with Microsoft's Kevin Gallo, Partner Director of Program Management, to talk about the first six months of Universal apps - and about where Microsoft is taking the technology, in light of its Windows 10 announcements.

There aren't many Universal apps in the various Windows Stores yet. That shouldn't be a surprise, as Gallo pointed out "People's code takes time to evolve." The technology is still relatively new, and many developers have yet to upgrade to the latest versions of Visual Studio - or have to support older operating system releases.

A key element of the future of Universal apps is the ability to share controls between user experiences, as Gallo notes, "We've not got all the controls yet, more are coming in Windows 10. Not all controls look the same across the platform; like the calendar control. We're fine-tuning the designs, making a family of design. It needs to be the best on that device." The goal is for a developer to share the most of the controls between different user experiences. One solution is for apps to use adaptive layouts, which is where support for WinRT's HTML5 JavaScript/CSS UI tools comes in, using the WinJS libraries in conjunction with responsive design.

So how will Universal apps evolve in Windows 10? Galllo unsurprisingly remains close-lipped about details, noting that the approach Microsoft is taking is evolutionary, "Our goal will be to do better automatic and adaptive layout, making it a natural on-ramp." That's going to require more work on the tool side of the story, with support for what Gallo calls "Universal Projects", as well as tools that will allow user experiences to be tuned for different device form factors.

Getting UX right for different form factors is an interesting problem: a phone is used differently from a phablet, which isn't the same as an 8-inch tablet in portrait mode. Then there's the differences between different tablet screens, aspect ratios, and whether they're hybrid two-in-one devices. Developers building apps that cross all these scenarios are going to need all the help Microsoft can give them (and that's before they start working with Kinect voice-driven Xbox apps).

Gallo points out that much of making apps work across multiple form factors is about getting inputs right. Are you developing for touch, for mouse and keyboard, or for speech, or even pen? Windows 8.1 includes the option to support dual inputs, using the current interaction mode to define how apps respond to user input. That means user actions and app controls need to be closely linked, so you get the best support for multi-modal devices. There's no way to predict just how a user will interact with a universal app - or what type of computer they might be using. Apps will need to handle all possible input modes, so support will need to be built into the controls Microsoft (and its partners) ships.

Windows 10 is a big opportunity for Universal apps, and Gallo notes that, along with expanding the WinRT APIs in the next release, Microsoft will be opening up some more Win32 APIs to Universal apps. It'll also be adding controls that work well on the desktop, as well as in touch. That's an important change, as it aligns closely with Windows 10's desktop focus and its support for windowed Universal apps.

Microsoft has a lot of work to do. While developers are happy with the current Universal app model, its expansion across the entire Windows ecosystem means that, as Gallo says, "The next version has a very large target, a broad ecosystem." Microsoft needs to deliver quickly to move the industry forward, with support that lets users work with the devices that meet their needs - not what developers think they need to use. Gallo is clear about this, "Users will pick and mix, in interesting and unique ways. People pick the set that meets their human needs. There is no uniformity."

So what of the future? Gallo told us that Microsoft would be continuing to deliver on what it announced six months ago at Build. "The biggest asset we bring is the breadth of devices we support," he said, "But also the biggest challenge we have. There are other inputs, like Kinect, that no one else has. We need to be best on every device."

That's a challenge for Microsoft and for Universal app developers. While Microsoft is making it easier for developers to deliver those universal front ends, there's another, much bigger, part of the story that's yet to be told: how its middleware and services fit into the story.

One of the first Universal apps to hit the various Windows stores was Tweetium, a Twitter client developed by long time Windows developer Brandon Paddock. Tweetium began as a Windows 8.1 app, using a HTML5 UI. When Microsoft unveiled Universal apps, Paddock was able to quickly deliver an initial Windows Phone build. He could take advantage of the small screen views he'd designed for Windows snap views, and comment out the code written for working with specific Windows 8.1 functions.

Actually turning that prototype into a full-blown app took more work. There's a lot to consider when bringing an app from the relatively unrestricted PC world to a phone. Code that's designed for specific OS features needed to be wrapped or shimmed so it worked unchanged, letting Paddock deliver common features with different user experiences - so the common settings page could be displayed from the Settings charm on Windows 8.1 or from an app bar menu item on phones. Then there were more complex tasks, tuning app usage for phones with slow processors and only 512MB of RAM. Paddock notes that has improved performance on PC-class devices, "One of the great things is that this work benefits PCs, too, so the app is now even faster on my Surface Pro 3. The same goes for improvements I made to the app's portrait and snap layout, which is what you see when you run the app on most phones."

The shim that Paddock developed for handling the differences in settings between platforms is the only real difference between PC and phone code. Paddock notes that apart from specific runtime checks for customizations what he delivers is the "Same HTML, same JS, same CSS." The other key issue is that he has to create separate packages for each version and deliver them through two separate stores - which causes issues in delivering and managing in-app purchases.

Another developer, Ginny Caughey, is looking forward to bringing the skills she's learned building consumer Universal apps into the enterprise code she works with in her day job. She's already receiving requests for touch versions of those apps, and finding issues in adding touch support to legacy code. She notes that Windows 10 seems to be quickly gaining enterprise acceptance, even as an early technical preview, "The support staff in my office - the people who actually have to support our customers in the field and on the phone - are enthusiastic that Windows 10 is familiar enough for the task workers who use our enterprise software, requiring minimal training. All our legacy code runs just fine on even this first release of Windows 10 Tech Preview."

As Caughey notes, the Universal apps model works well for enterprise app, where business logic and user experience are kept separate. Universal app shared projects mean business logic can be encapsulated and given appropriate UIs for each device, "accessible to back office knowledge workers on desktops who need reporting and Office integration as well as accessible in simplified form to task workers on mobile touch devices for point of sale functionality."

It's not going to be an overnight change, and Caughey anticipates a gradual shift to the new model in enterprises. As she notes, it's not a new issue for enterprise developers, "I've been at this crossroads before with my enterprise code base and used COM to bridge the gap between the legacy win32 code and the newer .NET code." Even so she expects Microsoft will deliver tools in the Windows 10 time frame that help her deliver these changes to Windows 10 users, while helping her continue to support older versions of Windows.

Other developers I spoke to are optimistic, with frameworks for Universal app development being shared on sites like Github. Microsoft seems to have found a sweet spot with Universal apps that helps developers solve a perennial problem, while giving them the tools they need to support the next generation of Windows across all sizes of screen - from 4 inches to 55 inches.

Caughey's final comment sums up the developer response, "Now I can realistically target Windows 10 features confident that my enterprise customers won't balk before even trying it as they seem to have done with Windows 8." It's a response that's going to make Redmond very happy as it rolls out the next generation of Windows.

This story, "Universal Apps is the Future of Windows Development" was originally published by CITEworld.

To comment on this article and other CIO content, visit us on Facebook, LinkedIn or Twitter.
Download the CIO October 2016 Digital Magazine
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.