I have a Hololens app built using Unity 2019.3. Within the app, I am trying to use a onClick event on a button to open Microsoft Dynamics Remote assist.
I have tried to follow this tutorial. https://learn.microsoft.com/en-us/archive/blogs/appconsult/call-remote-assist-from-your-hololens-app
This tutorial says to use .net as the scripting backend, however Unity 2019.3 only allows IL2CPP as the scripting backend.
Have tried the code from this thread as well but still not working.
Execute "LaunchUriAsync" from a click of a HoloLens UI Button
Getting the following errors:
I tried a new project in Unity 2018.4 with scripting backend set to .NET and getting similar errors there as well.
I can't find anything online on how to get Launcher.LaunchUriAsync to work.
This tutorial says to use .net as the scripting backend, however Unity 2019.3 only allows IL2CPP as the scripting backend.
That doc is a bit outdated. We recommend using the latest Unity LTS (Long Term Support) as the best version so that we can avoid some known issues, and the current recommendation is to use Unity 2019.4.20f1.
And we don't need to set .NET as Scripting Backend anymore since IL2CPP is the best and only choice for now.
Some key steps are:
Create a new project in the latest LTS version Unity
Ensure the target platform is Universal Windows Platform. See File->Build Settings
Build the Unity project (You choose a folder in which Unity generates a Visual Studio solution; Usually, we create a new subfolder of the Unity project named App).
Open the new generated Visual Studio solution file and set the right configuration, build and run.
If you still need help, please paste the C# script clicker.cs
Related
I develop applications targeting the Hololens 2 platform (mixed reality).
The general idea of the application I am trying to build is using a point cloud registration algorithm, which targets a previously scanned model on one hand and the visible point cloud generated by the Hololens' SceneUnderstanding ability on the other.
My main problem is that all the different implementations that I found of the algorithm are using libraries (DLLs) that:
Uses a lower-level language (C++) than the C# scripting language used in Unity's scripts.
Are not targeting the needed configuration and architecture needed for deploying an application on the Hololens 2 (Master configuration, ARM64 architecture).
In the process of trying to generate that kind of library myself (using visual studio 2019 to build "Dynamic-Link Library with Exports [DLL]"),
I created the simplest library in C++ - A single function that returns an integer (without the dependency of any other library). Obviously, when targeting the Unity Editor application it was easy to use the library's function from the C# script attached to the Unity project, but when I try to convert the solution's configuration and architecture to Master ARM64, building a Visual Studio solution and deploying the application on the Hololens 2 generates a script error: "Unable to load DLL '<dll_name>': The specified module could not be found."
I can think of two major reasons that will cause this problem:
The program can not find the library needed for function execution,
JUST BECAUSE the location of the library is not correct (I have NO IDEA
where the library should be placed in the solution hierarchy).
I am probably not using the right technique for converting the library to the correct target solution properties (in addition of the previous scenario)
(and as well, I have no idea what is the correct procedure for achieving correct targeting properties)
Using: Visual Studio 2019, Unity 2019.4.1f1, Hololens 2nd generation
It would mean a lot to hear from anyone who have encountered any sort of similar problem, thank you in advance!
To add a custom DLL to a Unity project for HoloLens 2, you have to copy the DLL to a folder called Assets/Plugins/WSAPlayer/ARM64 in your project hierarchy in Unity. Then, you should also make sure that the correct Platform settings are specified for the Plugin in the Inspector, i.e., SDK should be set to UWP and CPU to ARM64:
This git repo has an example of this (DLL and Unity project).
Note that the DLL has to be compatible with Universal Windows Platform (UWP), so when creating a new library with Visual Studio, you should select either the DLL (Universal Windows) or Windows Runtime Component project templates as your starting point.
If you add any dependencies to your DLL, e.g., for point cloud registration, you will also have to build those libraries for UWP / ARM64, and add those DLLs to the same folder as well!
I want to build app for a Hololens project, However I can not check the Unity C# projects in the debugging checkbox.Is there a way to activate it ?
You're currently targeting any device and not just hololens. Since you want to make an application for the HoloLens I'm guessing you already have the Holotoolkit imported.
If you haven't, then I'd recommend you do so as this is a great starting point for any Hololens application and it has a lot of useful tools which will make developing for hololens much easier.
If you do, you can select the Holotoolkit -> configure -> project settings. This will configure your project settings for the Hololens. When you've done that you should be able to use Debugging C# projects
I am now starting to learn android development.
I made a small app in visual studio using xamarin (C#) and I wanted copy it to android studio so I can also learn a new language and a new IDE.
I currently have a solution (App.sln) under that I have the main project (App.csproj) and also a class library project to hold my classes (App.Model.csproj)
In android studio, do I create a new module and call it com.app.model or do I just create a new package in the main module?
If you are currently using Xamarin Native approach, the porting from C# to Android Java should be quite straight forward because most of the API is still the same name. The difference mostly is just TitleCase in C# but camelCase in Java. Also, you will need to rename Android layout file from *.axml to *.xml.
If you are using Xamarin.Forms approach, then you will not able to port to Java easily because the API is totally different compare to native Android now. Xamarin.Forms is having its own API set that mapped back to individual native platform's API.
Checking out native Android tutorial will help you to understand better. However, why you want to go back to native when you already know about Xamarin. I came from Android native background and I didn't look back into native since I started with Xamarin.
I want to develop an app with Xamarin Forms which detects devices and interacts with them by bluetooth connection.
The plugin "Plugins.BLE" seems good to me for my request. I found this plugin here : https://github.com/xabre/xamarin-bluetooth-le
I did not find the plugin "Plugins.BLE" when I wanted to install it in Xamarin Studio, so I tried to use the MvvmCross.Plugins.BLE plugin. So I downloaded it and installed it in my project. A reference to MvvmCross.Platform has been installed in the same time. I set the permissions for bluetooth in the AndroidManifest.xml.
I have many problems with this plugin. In the first place, I initialized an adapter like this :
var adapter = Mvx.Resolve<IAdapter>();
I put this code in my App.xaml.cs but I got a NullReferenceException when I build.
Otherwise, when I put
var ble = Mvx.Resolve<IBluetoothLE>();
Xamarin Studio does not recognize the IBluetoothLE interface.
Maybe errors come from MvvmCross using. I don't want to use MvvmCross so if the plugin "Plugin.BLE" is available I would like to use it but I did not find it.
You have to search for pre release. Currently we haven't released a "stable" 1.0 without the "-beta" postfix. Every package thats version have "-foo" postix are recognized as prerelease by nuget.
The null reference exception is a typical error if you haven't referenced the platform specific package in your iOS or Android app. Running the package on a simulator can cause some problems, too. We are working on this.
Following a comment posted to one of my questions, I am trying to get started using DirectInput.
I am absolutely unfamiliar with it, and I don't know how to get started at all. The namespace seems to be Microsoft.DirectX.DirectInput but I cannot seem to find it anywhere in my references.
It says in several places that you just have to add it from the references in my project but I couldn't find it.
I checked for a DirectX SDK but it seems it is now part of the Windows SDK and the Windows SDK is already installed with Windows 8 so I shouldn't have to do anything?
I found a couple of alternatives, of which SharpDX sounds like a good one. I have not been able to start with this either... I have installed the SharpDx.Input nuGet package but I can't seem to use the code I can find elsewhere, like here.
new DirectInput() for instance is not recognized at all by Visual Studio.
The "Microsoft.DirectX.DirectInput" assemblies are Managed DirectX 1.1 and are deprecated. Furthermore, VS 2013 defaults to using .NET 4.x which is not supported by legacy Managed DirectX 1.1. See DirectX and .NET.
The underlying DirectInput component whether used by C# or C++ is legacy and is not recommended for use for mouse or keyboard. For Xbox One and Xbox 360 common controllers, we recommend using XINPUT. To use legacy HID devices (joysticks, PS3 controllers, some haptic controllers, etc.), you still use DirectInput. For XINPUT use on Windows 8.x, see this blog. For use from C++, you should look at DirectX Tool Kit particularly the GamePad class.