In-Depth

The Universal Reach of Windows

Microsoft has a plan for unifying all your desktop, mobile and even sundry device applications onto a single target with the new Universal Windows Platform.

All for one and one for all. It's a rallying cry that's well suited to the new Microsoft Universal Windows Platform (UWP), which aims to pull together the disparate collection of Microsoft compute platforms so developers can write a single program to run on all flavors of the Microsoft Windows OS. By this time next year, a Windows app intended for desktop and laptop PCs will also be able to run -- unmodified -- on compatible Windows Phone handsets, Windows Servers, Xbox game consoles, even embedded, Windows-­based smart devices for the Internet of Things (IoT).

This one-size-fits-all vision for application development is a far cry from software today, where programmers must write and maintain discreet code bases for the same application running on desktop, mobile and other devices running Microsoft OSes. But as Terry Myerson, executive vice president for the Microsoft Operating Systems Group, said during a keynote presentation heralding the launch of the upcoming Windows 10 OS at the recent Microsoft Build conference in San Francisco and reiterated at last month's Ingite conference in Chicago, all of that is poised to change.

"Windows 10 represents a new generation of Windows built for an era of more personal computing, from Raspberry Pi to the holographic computer, where the mobility of the experience is what matters, not the mobility of the device," said Microsoft CEO Satya Nadella during the opening keynote at Build. "With Windows 10 we are targeting the largest device span ever, Myerson added, as he gave the UWP vision and demonstration. "We're talking about one platform -- a single binary that can run across all these devices."

If this sounds familiar, you probably recall the long-departed Chief Software Architect Ray Ozzie's 2008 vision of "three screens and a cloud." More recently Microsoft last year rolled out a universal apps initiative -- the Universal Windows apps effort that enabled shared program code between Windows Phone handsets and Windows PCs. The initiative arranged things so an application written for Windows Phone 8.1 could run also on Windows 8.1, and vice versa. To gain this capa­bility, however, developers had to craft two UIs for their applications -- one for tiny phone screens and one for larger tablet and PC displays -- blunting the value of the approach. The results were clear: few apps and lackluster demand for the current version of Windows.

Joe Belfiore, corporate vice president of the Operating Systems Group at Microsoft, explains the Universal Windows Platform means developers don't have to write separate code for different device types.

Microsoft's new Universal Windows app scheme is a far more ambitious affair. At its core the UWP is a common set of APIs shared by all flavors of Windows, from the small (phone, IoT devices) to the large (Windows Surface Hub) and to everything in between (PCs, Xbox controllers). Programmers writing Windows apps don't write applications for a specific desktop, mobile or device-bound flavor of the OS as they do currently. Instead, they write apps for the baseline UWP, and add device-specific functionality as needed.

This is a big deal. Microsoft had to create a new underpinning for its entire Windows franchise, then move the different Windows OSes atop it.

"We had to go through a lot of work with the Universal Windows Platform," says Clifton Simpkins, senior product manager for Windows Platform Developer Marketing at Microsoft. "Windows had different kernels, different operating systems, different driver models and different form factors. As we went through Windows 8 and especially with Windows 10, there was a lot of work on our part to get back to one Windows core."

The effort has made an impression. Billy Hollis, a partner at Next Version Systems and an expert on UI systems, describes the UWP presentation at Build 2015 as "more innovation than anything I've seen from them since PDC 2000." Hollis is referring to the Professional Developers Conference 15 years ago when Microsoft introduced the Microsoft .NET Framework, marking one of the most important strategic changes of direction in the company's history at that time.

The differences among these platforms is profound. Surface Hub is designed for groups gathered in conference rooms and meeting with others via video link, while tiny credit-card-size Raspberry Pi devices have no visual interface at all. Enabling a common Windows experience across all these devices is one thing, enabling a compelling Windows experience on each of them is something else, entirely.

Simpkins describes a modular architecture that lets devel­opers tune their apps for specific device types by making calls to extension APIs that sit above the UWP. A corporate app developer building a video conferencing app might opt to call extensions for the Windows Phone, PC and Surface Hub exten­sions, to take full advantage of each platform's capabilities, while a mobile-specific expense account app would call only to the Windows Phone extensions.

"You have these device family API extensions that sit over top of [the UWP]," says Simpkins. "So if I'm in Visual Studio and I say I want to handle Xbox, it will bring in these Universal Windows Platform extensions that allow me to target specific capabilities that are explicitly available on the Xbox." He adds that a developer selecting the desktop target would be able to do things like call into the legacy Win32 API and perform a host of other desktop-specific activities.

What happens when a Windows app tries to call a feature or function that isn't present for the type of device on which it's running?

"You can call all the APIs, [but] the operating system may decide to treat some as no ops," Simpkins says. "So if you are on an Xbox and you are calling Bluetooth APIs and the Bluetooth stack is not quite the same as desktop, it won't crash. It'll handle it, it will deal with it gracefully, but it will say, ‘You know what, this is not applicable for this device as it sits.'"

"With Windows 10 we are targeting the largest device span ever. We're talking about one platform -- a single binary that can run across all these devices."

Terry Myerson, Executive Vice President, Operating Systems Group, Microsoft

Critical to the success of Microsoft's universal approach is the adaptive UI scheme, called Continuum, which allows Windows apps to optimize their layout and behavior based on the detected form factor and available inputs. Microsoft's Myerson at the Build event demonstrated a Windows 10 app from newspaper USA Today gracefully stepping down from a full-screen PC to a Windows Phone. He also showed how the same app, when running on an Xbox game controller, was programmed to only display video content. Notably, the app maintained its session state across platforms -- when Myerson switched from PC to phone, the phone app opened on the same content that had been last displayed on the desktop PC.

The concept of responsive UI is hardly new -- developers have been creating responsive Web sites with jQuery for years. The trick, as Joe Belfiore, corporate vice president of the Operating Systems Group at Microsoft notes, is to do so automatically. "Not by writing separate code," he says, "but by having a platform that's smart enough to do it -- in fact, even dynamically on the same device."

The ultimate expression of this might be the demo Belfiore provided, showing a simulated Windows Phone connected to a large screen monitor via HDMI and equipped with a Bluetooth keyboard and mouse. He demonstrated how a Windows Phone-based PowerPoint presentation, with its compact UI, transitioned to the full desktop experience once the phone output to the large display.

"What you see on the big screen here sort of looks like the version of PowerPoint that you would see on the PC," said Belfiore, "because in fact it is the same code as the version of PowerPoint that you would download from the Store and see on the PC."

Will the Microsoft adaptive UI scheme really make it possible to slide apps from desktop to phone to Surface Hub to Xbox without compromise? Julian Bucknall, chief technical officer of Windows components and tools provider Developer Express, says the "restricted" displays of smartphones pose a challenge.

"A design for a phone is completely different from a design for a desktop," he says. "A grid control on a phone is useless, it really is. A grid on a phone becomes a list of lists of lists. Your first column is shown as a list, then you click on a first column item and you get another column and you swipe back and forth."

Building Bridges
Universal Windows apps and the UWP specifically address the next generation of software written for the Windows 10 OS. But Microsoft has been hard at work extending its universal vision to existing software, both within and beyond Microsoft borders.

Legacy Windows desktop applications written for the managed .NET Framework and native Win32 APIs will install and run on Windows 10 systems, within sandbox environments based on the Microsoft App-V application virtualization technology. The approach allows legacy Windows applications to be safely installed on Windows 10 PCs without requiring access to Registry and other system resources that can yield security and compatibility concerns. Perhaps most important, the sandboxed scheme makes it possible for legacy Windows applications to be procured directly from the Microsoft Store.

Brian Lagunas, product manager for component maker Infragistics, says Microsoft Store availability is a huge deal for businesses that need to maintain legacy applications, including those running the Windows Presentation Foundation (WPF) technology -- a cousin of the XAML scheme present in Windows 10.

"The enterprise has a story now," Lagunas says. "With previous releases of Windows 8, the enterprise really had no benefit to upgrade. What's in it for us? We lose all this functionality from WPF. Well, now they have a migration story. You can put your WPF apps in the Store." Lagunas says companies can then start migrating apps to Windows 10 to take advantage of the more extensive API sets available there. "I don't know if you saw the list of the APIs they provided, but it is massive," he says. "Massive."

In another critical move, Microsoft will also build Bridges to rival mobile phone platforms, providing tooling for developers to migrate iOS Objective-C code for iPhones and iPads, and C++ and Java code for Android devices to the UWP. For iOS apps, developers will be able to import their Apple Xcode projects into Visual Studio and compile the Objective-C code to C. From there, says Simpkins, developers "can mix and match" the recompiled code with XAML to provide additional native Windows functionality.

The approach for Android apps is different, eliminating the need to recompile apps to run on mobile Windows 10 phone and tablet devices. Microsoft will include a runtime for executing Android application package (APK) program files on Windows Mobile, though lack of comprehensive API support means that some Android apps may not run on Windows 10 mobile OS devices.

Hollis calls bringing Android apps to Windows Phone "a shrewd bet."

"Windows Phone devices are very nice, very reasonably priced, and many users find the OS very easy to use," he says. "Lack of apps is a major constraint, and if that disappears, it might really boost sales of Windows Phones. No guarantees, but I think it was a bet worth making."

Looking Forward
Microsoft's effort to "defragment" its Windows family has drawn positive reviews from industry watchers, who've seen Microsoft struggle through a number of painful platform transitions over the years. Al Hilwa, program director for Software Development Research at IDC, says with the Universal Windows apps model the company took an important step forward in renewing the appeal of Windows to the developer community.

"I think if you look at the totality of what they have done in terms of increasing the attractiveness of the platform to developers, it is one of the most widespread outreach efforts I have ever seen in the industry," Hilwa says.

Hilwa emphasizes the portfolio of back-end services that Microsoft brings to the fight, including Microsoft Azure compute and storage resources, Bing search, Maps and OneDrive. And he notes the importance of Microsoft's effort to monetize Windows app development directly through the Windows Store -- which will support both legacy .NET and Win32 applications, as well as Android and iOS mobile apps. "As monetization shifts from a Windows-centered approach, appealing to other developers no matter the modality becomes more compelling to Microsoft," he says.

The effort will take time. Microsoft has proclaimed its goal is to install 1 billion copies of Windows 10 on devices within three years, and the company has announced a free upgrade path to Windows 10 for PCs running Windows 7, Windows 8 and Windows 8.1 to help achieve that figure. Bucknall, of Developer Express, says it will be a while before demand for Windows 10 and its universal platform heats up.

"I'm going to guess it is going to be somewhere later on that three-year curve that people will start coming to us and saying, ‘Damn it, we need this,'" Bucknall says. "We're ready, but initial uptake is going to be dreadful."

Hollis says Windows 10 may end up succeeding for reasons most people don't expect. He says he sees few valid use cases for business apps being able to run on multiple device types. But the unified platform and robust UI model will create payoffs for dev shops, regardless.

"Each app we write will likely be targeted at a particular device," he says. "But once we've got, say, a desktop app on universal apps, writing a related but different tablet app ought to be way easier. I get to reuse lots of assets and plumbing, and I get to use the same markup language and native code engine."

Perhaps most important, says Hollis, is that Microsoft's strong and coherent universal appeal may help developers and IT professionals move past the jarring dislocations they've suffered over the years. He says the company made a clear, strategic commitment to XAML as its UI platform going forward.

"This puts to rest any doubts about the long-term viability of XAML. It also assures developers of a UI platform that will have stability and performance better than any past XAML platform, such as WPF or Silverlight," Hollis says. "This was one of the biggest results of Build for me, and I liked the fact that they didn't make a big deal of it. It was just assumed that if you want to be doing some of these highly innovative things, XAML and universal apps will be your UI stack."

Featured

comments powered by Disqus

Subscribe on YouTube