App model

HoloLens uses the app model provided by the Universal Windows Platform (UWP), a model and environment for modern Windows apps. The UWP app model defines how apps are installed, updated, versioned and removed safely and completely. It governs the application life cycle - how apps execute, sleep and terminate - and how they can preserve state. It also covers integration and interaction with the operating system, files and other apps.

2D apps arranged in holographic shell in a breakfast area

App lifecycle

The lifecycle of a holographic app involves standard app concepts such as placement. launch, termination and removal.

Placement is launch

Every app starts by placing an app tile (just a Windows secondary tile https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.startscreen.secondarytile.aspx) in the HoloLens shell. These app tiles, on placement, will start running the app. These app tiles persist and stay at the location where they are placed, acting like launchers for anytime you want to get back to the app.

Placement puts a secondary tile in the world

As soon as placement completes (unless the placement was started by an App 2 App launch), the app starts launching. HoloLens apps can run one app at a time. As soon as you place and launch an app, any other active app will suspend, leaving a screenshot of its last state on its app tile wherever you placed it. See app lifecycle for more information on handling resume and other app life cycle events.

After placing a tile, the app starts running State diagram for app running, suspended or not running

Remove is close/terminate process

When you remove a placed app tile from the world, this closes the underlying processes. This can be useful for ensuring your app is terminated or restarting a problematic app.

App suspension/termination

With HoloLens, the user is able to create multiple entry points for an app. They do this by launching your app from the start menu, and placing the app tile in the world. Each app tile behaves as a different entry point, and has a separate tile instance in the system. A query for SecondaryTile.FindAllAsync() will result in a SecondaryTile for each app instance.

When a UWP app suspends, a screenshot is taken of the current state.

Screenshots are shown for suspended apps

One key difference from other Windows 10 platforms is how the app is informed of an app instance activation via the CoreApplication.Resuming and CoreApplication.Activated events.

ScenarioResuming Activated
Launch new instance of app from the Start Menu Activated with a new TileId
Launch second instance of app from the Start Menu Activated with a new TileId
Select the instance of the app that is not currently active Activated with the TileId associated with the instance
Select a different app, then select the previously active instance Resuming fired
Select a different app, then select the instance that was previously inactive Resuming fired Then Activated with the TileId associated with the instance

Extended execution

Sometimes your app needs to continue doing work in the background or playing audio. Background tasks are available on Windows Holographic with some limitations.

Apps can run in the background

App views

When your app activates, you can choose what type of view you'd like to display. For an app, CoreApplication, there is always a primary app view and any number of further app views you would like to create. On Desktop, you can think of an app view as a window. Our Holographic app templates will create a Unity project where the primary app view is Holographic. Your app can create an additional 2D app view using technology like XAML, to use Shell controls like in-app purchase. If your app started as a universal app for devices other than HoloLens, your primary view is 2D, but you could "light up" on HoloLens by adding an additional app view that's Holographic to show an experience volumetrically. Imagine building a photo viewer app in XAML where the slideshow button switched to a Holographic app view that flew photos from the app across the world and surfaces.

The running app can have a 2D view or a holographic view

Creating a Holographic view

Holographic apps are those that create a holographic view, which is done by the HolographicSpace type.

Apps running in holographic view are the only one visible

2D view in the Mixed World

Anything other than a Holographic view is rendered as a 2D view in your world.

Apps running in 2D view share the space in the mixed world with other apps

Placement of further App Tiles

You can place as many 2D views in your world as you want with Secondary Tile APIs. These "pinned" tiles will appear as splash screens that users must place and then can later use to launch your app. Windows Holographic does not currently support rendering any of the 2D Tile content as live tiles. You can find out more about the secondary tile APIs.

Apps can have multiple placements using secondary tiles

Switching views

Switching from the 2D XAML view to the holographic view

If the app uses XAML, then the XAML IFrameworkViewSource will control the first view of the app. The app will need to switch to the holographic view before activating the CoreWindow, to ensure the app launches directly into the holographic experience.

Use CoreApplication::CreateNewView and ApplicationViewSwitcher::SwitchAsync to make it the active view.

NOTE:

  • Do not specify the Consolidate flag to SwitchAsync when switching from the XAML view to the holographic view, or the slate that launched the app will be removed from the world.
  • SwitchAsync should be called using the Dispatcher associated with the view you are switching into.
  • You will need to SwitchAsync back to the XAML view if you need to launch a virtual keyboard or want to activate another app

Apps can switch between 2D views and holographic views When an app goes into a holographic view, the mixed world and other apps disappear

Switching from the holographic view back to a keyboard XAML view

One common reason for switching back-and-forth between views is displaying a keyboard in a holographic app. The shell is only able to display the system keyboard if the app is showing a 2D view. If the app needs to get text input then they may write a custom XAML view with a text input field, switch to it, and then switch back after the input is complete.

Like above, you can use ApplicationViewSwitcher::SwitchAsync to transition back to a XAML view from your holographic view.

App size

2D app views always appear in a fixed virtual slate. This makes all 2D views show the exact same amount of content. Here are some further details about the size of your app's 2D view:

  • Aspect ratio of the app is preserved while resizing.
  • App resolution and scale factor are not changed by resizing.
  • Apps are not able to query their actual size in the world.

2D apps appear with fixed window sizes

App tiles

The Start Menu uses the standard small tile and medium tile for pins and the All Apps list on HoloLens. The start menu for Windows Holographic

App to app interactions

As you build apps, you have access to the rich app to app communication mechanisms available on Windows 10. Even though HoloLens currently does not support the new app service protocol launches, many of the new Protocol APIs and file registrations work perfectly on HoloLens to enable app launching and communication.

Protocols

HoloLens supports app to app launching via the Windows.System.Launcher APIs.

There are some things to consider when launching another application:

  • When doing a non-modal launch, such as LaunchUriAsync, the user must place the app before interacting with it
  • When doing a modal launch, such as through LaunchUriForResultsAsync, the modal app is placed on top of the window
  • HoloLens cannot overlay applications on top of exclusive views. In order to show the launched app, HoloLens takes the user back to the world to display the application.

File pickers

HoloLens supports both FileOpenPicker and FileSavePicker contracts. However, no app comes pre-installed that fulfills the file picker contracts. These apps - OneDrive, for example - can be installed from the Windows Store.

If you have more than one file picker app installed, you will not see any disambiguation UI for choosing which app to launch; instead, the first file picker installed will be chosen. When saving a file, the filename is generated which includes the timestamp. This cannot be changed by the user.

By default, the following extensions are supported locally:

App Extensions
Photos bmp, gif, jpg, png, avi, mov, mp4, wmv
Microsoft Edge htm, html, pdf, svg, xml

App contracts and Windows Holographic extensions

App Contracts and extension points allow you to register your app to take advantage of deeper operating system features like handle a file extension or use background tasks. This is a list of the supported contracts and extension points in Windows Holographic. This is different than APIs that are supported.

Contract or Extension Supported?
Account Picture Provider (extension)Unsupported
AlarmUnsupported
App serviceSupported but not fully functional in the current version of Windows Holographic
Appointments providerUnsupported
AutoPlay (extension)Unsupported
Background tasks (extension)Partially Supported (not all triggers work on Windows Holographic)
Update task (extension)Supported
Cached file updater contractSupported
Camera settings (extension)Unsupported
Dial protocolUnsupported
File activation (extension)Supported
File Open Picker contractSupported
File Save Picker contractSupported
Lock screen callUnsupported
Media playbackUnsupported
Play To contractUnsupported
Preinstalled config taskUnsupported
Print 3D WorkflowSupported
Print task settings (extension)Unsupported
URI activation (extension)Supported
Restricted launchUnsupported
Search contractUnsupported
Settings contractUnsupported
Share contractUnsupported
SSL/certificates (extension)Supported
Web account providerSupported

App File Storage

All storage is through the Windows.Storage namespace, see the following for more details. HoloLens does not support App Storage sync/roaming.

Known folders

See KnownFolders for the full details of KnownFolders for UWP apps.

Property Supported on HoloLens Development Edition Description
AppCaptures YesGets the App Captures folder.
CameraRoll YesGets the Camera Roll folder.
DocumentsLibrary YesGets the Documents library. The Documents library is not intended for general use.
MusicLibrary YesGets the Music library.
Objects3D YesGets the Objects 3D folder.
PicturesLibrary YesGets the Pictures library.
Playlists YesGets the play lists folder.
SavedPictures YesGets the Saved Pictures folder.
VideosLibrary YesGets the Videos library.
HomeGroup NoGets the HomeGroup folder.
MediaServerDevices NoGets the folder of media server (Digital Living Network Alliance (DLNA)) devices.
RecordedCalls NoGets the recorded calls folder.
RemovableDevices NoGets the removable devices folder.

App package

With Windows 10 you no longer target an operating system but instead target your app to one or more device families. A device family identifies the APIs, system characteristics, and behaviors that you can expect across devices within the device family. It also determines the set of devices on which your app can be installed from the Windows Store.

See also