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.
The first step to bringing a 2D app to mixed reality headsets is to get your app running as a standard 2D app on your desktop monitor.
To build a new 2D app for mixed reality, you simply build a standard 2D Universal Windows Platform (UWP) app. No other app changes are required for that app to then run as a slate in mixed reality.
To get started building a 2D UWP app, check out the Create your first app article.
If you already have a 2D Windows app in the Store, you must first ensure it is targeting the Windows 10 Universal Windows Platform (UWP). Here are all the potential starting points you may have with your Store 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|
If you have a 2D Unity app today built as a Win32 app (the "PC, Mac & Linux Standalone" build target), you can target mixed reality by switching Unity to the "Universal Windows Platform" build target instead.
We'll talk about ways that you can restrict your app specifically to the HoloLens device using the Windows.Holographic device family below.
If you've deployed your 2D app to the desktop machine where you are developing and tried it out on your monitor, you're already ready to try it out in an immersive desktop headset!
Just go to the Start menu within the mixed reality headset and launch the app from there. The desktop shell and the holographic shell both share the same set of UWP apps, and so the app should already be present once you've deployed from Visual Studio.
Congratulations! Your app is now using the Windows 10 Universal Windows Platform (UWP).
Your app is now capable of running on today's Windows devices like Desktop, Mobile, Xbox, and HoloLens as well as future Windows devices. However, to actually target all of those devices, you will need to ensure your app is targeting the Windows.Universal device family.
Now let's jump into your AppX manifest to ensure your Windows 10 UWP app can run on HoloLens:
<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:
With Desktop headsets, users can use motion controllers to point at apps and take action. They can also use a gamepad, targeting objects with their gaze.
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.