12 Aug 2016

How Powerful Is UWP Compared to iOS or Android?

Windows 10 offers a new, modern API, called Universal Windows Platform (UWP) née Modern née Metro. UWP apps are responsive, running from phone to tablet to laptop to Xbox. They can be used only with touch (like on phones), only with a keyboard and mouse (like on a traditional laptop), or both (like on a touchscreen laptop). They are resolution-independent: your screen can have any number of pixels per inch, and the UI doesn't become tiny or oversized. The OS can shut down UWP apps to reclaim memory. Apps make judicious use of the battery, CPU and memory. Apps are sandboxed and don't interfere with each other or with the system. And so on.

But how limited is UWP? A good point of comparison is iOS, which is the most restrictive widely used OS. How does UWP compare with iOS? What can UWP apps do that iOS apps can't, or vice-versa?

Here are some APIs that are available on UWP but not on iOS:
  • Apps can talk to each other without restrictions.
  • Access the user's Documents folder or removable drives (filtered to the file types the app can open).
  • Scan and connect to Wifi networks, and toggle Wifi and Bluetooth radios.
  • Access location history.
  • Manage other apps.
  • Observe, suppress or inject raw input, like keystrokes.
  • Access recorded calls.
  • Code generation for JIT.
Unlike iOS apps, which need to be distributed in the Apple app store, you can distribute UWP apps outside the Microsoft app store. If you do that, more APIs are available:
  • Unlimited background execution.
  • Delay closing the app.
  • Invoke and pass commands to Cortana.
  • Access stored wallet cards.
  • Read and modify call log.
  • Modify contacts.
  • Read emails, and send emails as the user.
  • Project the screen onto another device.
  • Access credentials that can unlock a remote PC.
Conversely, here are some things iOS apps can do that UWP apps can't: 
  • Document provider (like Dropbox).
  • Action extensions that can do things like watermark a document, translate it, or add something to a wish list.
  • Provide a custom keyboard.
  • Define an audio unit that other apps can embed in them to process audio, say to speed it up.
  • Record audio in the background.
  • Act as a Bluetooth accessory.
Comparing just store apps, you can see that both platforms offer limited APIs. They are roughly on par [1].

No wonder UWP has had limited adoption [2]. When WPF and Win32 are available, with far more power, it's not surprising that the majority of developers are sticking with them, ignoring UWP.

So, UWP is on par with iOS. Unless you're willing to distribute your app outside the Windows app store, in which case UWP has significantly more capabilities than iOS.

Android


Moving on from iOS, how does UWP compare with Android? Android is a far more open and extensible system. It turns out Android apps can do all the things UWP apps can, except for:
  • Access location history.
  • Observe, suppress or inject raw input, like keystrokes.
  • Manage other apps.
  • Access recorded calls. (Android instead has an API that lets an app record an ongoing call. It works on only some devices.)
  • Delay closing the app.
  • Access stored wallet cards.
  • Unlock the device.
  • Set the default location.
Android apps can also do some of the things iOS apps can:
  • Document provider (like Dropbox).
  • Provide a custom keyboard.
  • Record audio in the background.
  • Act as a Bluetooth accessory.

In summary, if you're distributing a UWP in the Microsoft app store, the APIs are restrictive, roughly on par with iOS. If you're distributing a UWP app outside the Microsoft app store, significantly more capabilities are available than on iOS.

Android has significantly more APIs than either UWP or iOS. It was designed more as a general-purpose computing platform than as a limited, focused, mobile, "appliance-like" OS [3].

Why does this all this matter?

None of this matters if we're talking about phones or tablets that are used for content consumption. But as devices are made that aim to replace the laptop, like the iPad Pro and Chromebooks running Android apps, how powerful the platform is suddenly becomes an important aspect of the decision. iOS is a very limiting platform by PC standards. UWP is no better [4].

Hypothetically speaking, if there were a version of the iPad Pro running Android, with all the benefits of iOS — support from developers, an emphasis on simplicity, design and quality, the revenue that makes it all possible, and so on — that version of the iPad Pro would be more powerful than the one that exists today.

[1] Each has some important capabilities that the other doesn't. iOS has document providers, which allow apps to act as a filesystem to other apps. On the other hand, UWP allows apps to talk to each other without restriction. So, each has some powerful APIs that the other doesn't, but on the whole, UWP and iOS seem roughly on par.

[2] There are also other reasons, like legacy codebases and UWP apps not working on older versions of Windows, like 7.

[3] I don't like the phrase "appliance-like", but it's as good a term as any at conveying the limited nature of iOS compared to a general-purpose architecture like macOS, Windows or Android.

[4] No wonder Surface Pro 4s are used primarily in the desktop mode, running powerful Win32 apps, as opposed to in tablet mode, running newer UWP apps.

No comments:

Post a Comment