UWP 应用定义

UWP app definition

我们将开发一个 UWP 应用程序,它将用于移动设备和桌面设备。 在我们的演示中,我们可以说我们的应用程序是通用的,即使没有在 Surface Hub、Holo Lens 和 Xbox 上测试或部署吗?

您绝对可以使用世界通用的,因为根据定义,所有 Windows 10 个应用程序都是通用的,这些应用程序不使用某些将它们限制为仅适用于一个设备系列的特定 API。

早在 Windows 8.1 时代,针对 Windows 8.1 和 Windows Phone 8.1 的应用程序 也被称为 "Universal".

重点是,您部署的包在 Windows 10 PC 和 Windows 10 移动设备上 相同

通常这两个 SKU 是 Windows 10 名开发者的主要目标,只有少数开发者可以在 Xbox One 上进行测试,而在 Surface Hub 和 HoloLens 上测试的开发者则更少。

发布到 Windows 商店时,您可以将您的包限制为仅用于您测试过的设备系列。但是,在大多数情况下,即使不进行测试,你的应用程序也应该在 Surface Hub、HoloLens 和 Xbox 上运行良好(即使用户输入不会被优化并且它可能不会像预期的那样直观地运行)。

如果参考第一段Official Documentation

The UWP provides a guaranteed core API layer across devices. This means you can create a single app package that can be installed onto a wide range of devices.

但是:

Because your UWP app runs on a wide variety of devices with different form factors and input modalities, you want it to be tailored to each device and be able to unlock the unique capabilities of each device. Devices add their own unique APIs to the guaranteed API layer. You can write code to access those unique APIs conditionally so that your app lights up features specific to one type of device while presenting a different experience on other devices.

所以它是通用的,前提是您不会触发某些平台特定的 API 代码。而对于 UI,UWP 也使用自适应 UI 让应用程序适应不同的屏幕尺寸。