Windows Mixed Reality enables a user to see holograms as if they are right around you, in your physical or digital world. At its core, both HoloLens and the Desktop PCs you attach headset accessories to are Windows 10 devices; this means that you're able to run almost all of the Universal Windows Platform (UWP) apps in the Store as 2D apps.
Microsoft has been rapidly evolving the Windows platform over the past few years. That means many developers have different starting points even if they deliver an app to the Windows 10 Store today on Desktop, Mobile, or Xbox. This guide will focus on helping you get started when you have an existing app that you are trying to bring to mixed reality headsets, no matter where you're starting from.
To build an app for Windows Mixed Reality headsets, you must target the Universal Windows Platform - the developer platform introduced in Windows 10. That means to bring your app to HoloLens, you must first ensure it targets the Windows 10 Universal Windows Platform (UWP). We'll talk about ways that you can restrict your app specifically to the HoloLens device using the Windows.Holographic device family below. Here are all the potential starting points you may have with your app today:
|Starting Point||AppX Manifest Platform Target||How to make this Universal?|
|Windows Phone (Silverlight)||Silverlight App Manifest||Migrate to WinRT|
|Windows Phone 8.1 Universal||8.1 AppX Manifest that Doesn't Include Platform Target||Migrate your app to the Universal Windows Platform|
|Windows Store 8||8 AppX Manifest that Doesn't Include Platform Target||Migrate your app to the Universal Windows Platform|
|Windows Store 8.1 Universal||8.1 AppX Manifest that Doesn't Include Platform Target||Migrate your app to the Universal Windows Platform|
Congratulations! Your app is now using the Windows 10 Universal Windows Platform (UWP). Your app is now capable of running on todays Windows devices like Desktop, Mobile, Xbox, and HoloLens as well as future Windows devices.
Now let's jump into your AppX manifest to ensure your Windows 10 UWP app can run on HoloLens.
If your app already runs on Desktop PCs, you're set to have your app run as a 2D slate in mixed reality. To target HoloLens as well, you must ensure you are targeting the "Windows.Universal" device family.
<Dependencies> <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10586.0" /> </Dependencies>
If you do not use Visual Studio for your development environment, you can open AppXManifest.xml in the text editor of your choice to ensure you're targeting the Windows.Universal TargetDeviceFamily.
Now that your UWP app targets "Windows.Universal", let's build your app and run it in the HoloLens Emulator.
At this point, one of two things can happen:
HoloLens Development Edition is a new device target of the Windows 10 operating system, so there are Universal Windows Platform APIs that are still undergoing testing and development. We've experienced our own challenges bringing Microsoft UWP apps to HoloLens.
Here are some high level areas that we've found to be a problem:
To get to the bottom of what's causing your UWP app not to start on HoloLens, you'll have to debug.
These steps will walk you through debugging your UWP app using the Visual Studio debugger.
As mentioned above, there are known issues with APIs under testing and development for the HoloLens Development Edition. If you find that your app uses one of the APIs in the namespaces listed as having potential problems, use the Windows Feedback tool to send feedback to Microsoft.
How to open the Windows Feedback tool
We are continually fixing platform bugs in the APIs of UWP. For APIs that are failing by design - because they are not supported on HoloLens - here are the patterns that you can expect in your app and design around:
Now that your UWP app is running on Desktop headsets and/or HoloLens as a 2D hologram, next we'll make sure it looks beautiful. Here are some things to consider:
HoloLens uses advanced depth sensors to see the world and see users. This enables advanced gestures like bloom and air-tap. Powerful microphones also enable voice experiences. With Desktop headsets, users can use motion controllers to point at apps and take action. Windows takes care of all of this complexity for UWP apps, translating your gaze, gestures, voice and motion controller input to pointer events that abstract away the input mechanism. For example, a user may have done an air-tap with their hand or pulled the Select trigger on a motion controller, but 2D applications don't need to know where the input came from - they just see a 2D touch press, as if on a touchscreen.
Here are the high level concepts/scenarios you should understand for input when bringing your UWP app to HoloLens:
Voice input is a critical part of the mixed reality experience. We've enabled all of the speech APIs that are in Windows 10 powering Cortana when using a headset.
Once your app is up and running, package your app to submit it to the Universal Windows Store.