In today’s technologically advanced world, market needs a common solution for various platforms and considering that Microsoft moved with the market and announced Universal Windows Platform (UWP) to build a common solution for various windows devices.
Introduction
Universal Windows Platform is a homogeneous application architecture created by Microsoft. This means that you can create one single application package that can installed and used in various windows based platform including Personal Computers, Laptops, Tablets, Xbox, IoT, Mobile, IoT Headless, Surface Hub, HoloLens.
Designing an app that looks good on such a wide verity of devices can be a challenge. Fortunately, using the built-in features of Universal Windows Platform you can create modern UX that works well with the verity of devices, screens and input methods.
Features
Effective pixels and scaling
UWP apps automatically adjust the size of UI elements according to the size of the screen. For effective pixels and scaling, an algorithm introduced which used by the system to normalize the way of UI elements display on different screens. This scaling algorithm calculates viewing distance and screen density (pixels per inch) to optimize for perceived size (rather than physical size).
That means if the font size is set to 24px for one element, scaling algorithm ensures that 24px font on Bing screen far away is just as legible to the user as a 24px font small screen few inches away.
Secure
Just like mobile devices running under different environments such as Android and iOS, UWP apps will ask end-user to get the access for required components such as the microphone, webcam, location, USB devices, files, local drives, connected hardware and so on. The user must acknowledge and authorize that access before the app granted.
Common API surface across all devices
Core APIs of UWP is common for all devices. That means if you have used core APIs then it will run on any Windows 10 device no matter what you have targeted.
Extension SDKs expose the unique capabilities of specific device types
Extension SDKs allows you to call specialized APIs for different devices. For example, if you are focusing IoT devices, you can also add the IoT extension SDK to your project to target specific features, particularly to IoT devices. In addition, you can limit your application to work with the specific device from the Microsoft store. So that your app will run on allowed devices only.
Universal controls and layout panels
It helps to optimize UI for the screen resolution and density. It also helps to adjust the layout of content based on the size of the screen. Some of the changes will take place automatically based on screen and some of the changes need to be addressed. For example, buttons automatically adept screen size and density. However, when an app is running on the desktop computer, at that point the UI should adept the screen size for efficient use of the large desktop screen space.
Common input handling
It allows handling user inputs from various methods like a stylus, touch, a pen, a mouse, and a keyboard or Xbox controller.
Monetize your app
You can monetize your app as well. There are many options available on Microsoft store. For example,
- A paid download is the simplest option. Just name the price.
- Trials let users try your app before buying it, with “freemium” options.
- Sale prices to incentivize users.
- In-app purchases.
Seamless install, uninstall and upgrade
UWP apps distribution based on the packaging system. That means an app will never leave anything behind except documents on uninstallation. Apps also support modularized packaging that means the user can download content and extensions based on need or demand.
Familiar development environment
UWP apps used Windows Runtime, and native APIs developed in C++. That means one can develop WPA app using one of the following environment
- XAML UI and C#, VB or C++
- DirectX UI and C++
- JavaScript and HTML
UWP comparison with WPF
Subject | WPF | UWP |
System Requirement | Windows XP or later | Windows 10 |
Supported Devices | PC, Notebook, Tablet | Personal Computers, Laptops, Tablets, Xbox, IoT, Mobile, IoT Headless, Surface Hub, HoloLens. |
User Interaction | Keyboard and Mouse | Keyboard, Mouse, Touch, Stylus, Pen, Xbox Controller. |
UI Render | Vector graphics using DirectX | Vector graphics using DirectX |
Styling And Theming | Very Powerful but complex | Similar to WPF but with much more limitations. |
UI Definition | XAML | XAML |
Deployment | ClickOnce or classic Installers | Only through Microsoft Store.- Must pass certification- No full freedom on Price- Microsoft will take 30% of income. |
Resource access | No control. Resources accessible by the user can be accessed by the app. | Only granted resources can be used by the app. |
Performance | Managed code is in general slower than native code and requires more memory. | Apps written in C# or VB compiled to .NET Native. Thus, the app has almost the high-performance of a native app. |
Mature | Technology is in maintenance mode. Innovations or improvements cannot be expected. | Actively developing and growing technology. |
Development tools support | Visual Studio, Expression Blend | Visual Studio, Expression Blend |
Drawbacks | Slower than UWP because of the large, scale of managed code. | Distribution and resource access very limiting. |
Admin Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia