My main goal is to open a browser link from the holoLens app. But opening a link directly from the HoloLens App using this code:
Application.Open(url)
this does open the link but it actually closes/resets the HoloLens application, opening it again just resets it from its start like it wasn't open at all.
I experimented something: manually minimizing the HoloLens app. -> open a holographic browser, -> browse -> and then go back to the HoloLens app. And this method works, the HoloLens app did not reset or close.
So I'm researching for how to programmatically minimize the app, then open a browser. I found this:
followed the instructions by using some references also:
- https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
- https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations#device-capabilities
- https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/how-to-specify-device-capabilities-in-a-package-manifest
the references basically say, in order to minimize the app. you will need to use this code:
#if !UNITY_EDITOR
using System.Threading.Tasks;
using Windows;
using Windows.Storage.Pickers;
using Windows.System;
#endif
#if !UNITY_EDITOR
IList<AppDiagnosticInfo> infos = await AppDiagnosticInfo.RequestInfoForAppAsync();
IList<AppResourceGroupInfo> resourceInfos = infos[0].GetResourceGroups();
await resourceInfos[0].StartSuspendAsync();
#endif
and you also need to declare appDiagnostics
in the built folder's .appxmanifest
file
There were 2 .appxmanifest
on the built folder located in:
G:\Unity Projects\Build\build\bin\ARM64\Release\AppX
and
G:\Unity Projects\Build\build\bin\ARM64\Release
I edited both .appxmanifest
just to be sure.
So when I run the application with the changes, and run the script.. nothing happens.
also they say to properly open a holographic browser you need to use this:
System.Diagnostics.Process.Start(url);
but this is not working also. right after I did the script that should minimize the HoloLens application I run this, and still nothing happens..
what am I missing?