can not enable Unity C# debugging Hololens - c#

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

Related

Hologram is not shown in the hololens 2 while it's working in the desktop

I deploy my HoloLens 2 in Visual Studio through Release, ARM64, and Device. If I use the Release Machine instead of the Device, I got an error.
My desktop doesn't have the same Wi-Fi as my HoloLens. I can't connect my desktop and HoloLens to the same Wi-Fi.
My deploy is succeeded after I use the Device. My project Icon is shown in the HoloLens 2. But after I open the Icon, I can't see anything.
Please help me to find the solution. I spend a lot of time on this problem.
Maybe my explanation of Remote Machine and Device gave you some misunderstanding. I'm sorry about that. Remote Machine + WIFI and Device + USB are both officially recommended deployment methods. Since you have successfully deployed through Device, please continue to use it. If you are still a little confused about deployment you can publish a new thread.
It seems the main issue here is that when you run the deployed project, you cannot see any object. I recommend you try Remote Debugging(https://learn.microsoft.com/en-ca/windows/mixed-reality/develop/unity/preview-and-debug-your-app?tabs=openxr) in the Unity editor, which allows you to quickly preview and debug your project without deployment, and it can also be connected via USB. You can also use the official sample to Remote Debugging or deploy directly. Also, it's important to note that before you build your project in Unity, you need to add the scene to Build Settings->Scenes in Build.
Finally, I found the solution to my problem. Before I used the unity 2020.3.9. Now I changed the version to 2020.3.4. Now I can deploy and see the game objects in my hololens 2.
I had the same issue before. In the unity editor, I can see my models normally. But the models were not shown in Hololens, or only by one eye. The reason was that the models use the standard shader of Unity. After I applied the Mixed Reality Toolkit/ Standard Shaders, every model was shown.

Using Launcher.LaunchUriAsync for UWP app with IL2CPP scripting backend

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

BLE connection in Unity

I am new to Unity and BLE, so I am having trouble getting Bluetooth connection. I tried following along the solution posted here: BLE device with Unity
But, I can't work it out. I have added the WclGattClientDll to my assets folder, but can't figure out how to connect to my Bluetooth device. My Bluetooth device uses the heart rate service and works properly, since it connects to the manufacturers phone app.
Thanks in advance for any help/suggestions.
This could be down to a permission problem. It is possible to solve this issue in both Unity (pre-build) and Visual Studio (post-build). Here are both solutions:
Solution A: in Unity
Head to Edit > Project Settings > Player.
In the Inspector, open up the tab Publishing Settings.
Under the Capabilities section, make sure that Bluetooth is enabled.
Click on the .gif to expand
Solution B: in Visual Studio (2017)
In your Solution Explorer (Ctrl+Alt+L), expand your project.
Double-click the Package.appxmanifest.
Go to the Capabilities tab.
Again, make sure that Bluetooth is enabled.
Click on the .gif to expand
This will give your app the right to use Bluetooth.
https://github.com/adabru/BleWinrtDll
For my project I created a UWP-BLE wrapper as C++-dll that you can copy into Unity. It works for the Unity-Editor and the Windows standalone version. It has only the basic functions but you can extend it with the rest of the UWP-API if you are willing to write some C++.

How combine Unity project as a Library with Android Project Application

I have read a lot about this topic, how to integrate Android App with Unity App, and it's seem to be something really strange.
I have check post like this http://www.41post.com/5292/programming/unity-and-android-create-an-unity-app-with-a-custom-layout
which is working fine. But, in this case, the developer after export Unity Project to Android Studio, he start to develop his code inside the project that Unity has created.
This is not the same thing I have to do, I need to export Unity Project, make this a module marked as a Library and be imported for another Android Project.
Making this I have achived compile but in runtime I have different erros, some erros like "Unable to find Main", I have changed gradle and recompile with ndk to recognize .so files but is not working, when I open App it's say something like "Failure to initialize! Your hardware does not support this application, sorry!" and this have no sense because this Unity app has been tested in the same device and works.
Maybe is something that can't be done, and Im just totally lost.
Has someone make this happens?
Thanks,
Regards.

A very complicated workaround for using a C# dll with an Android app? (xamarin)

I have an proprietary Android app (created with Android Studio) and I need to add some functionality which requires to use a C# DLL.
The app is connecting wirelessly to a development board that does some sensor measurements. Normally on windows apps the dll is used to do some complex calculations of calibration coefficients for the measuring.
My problem is:
I don't have the the source code of the DLL and most likely I won't be approved to access it.
I've read that you can use xamarin to make android apps and use C# dlls but I can't rewrite the whole app for xamarin just to use the dll (also I've never used xamarin)
So far I had the idea to build a simple http server with C# that gets parameters with a GET request, runs them through the dll and returns the results. However it's not an ideal solution because it requires a separate pc to run the server and the adndroid device to have a network connection to it.
My second idea is to build a separate app with xamarin that uses the dll and make my main app start it just to calculate the coefficients and get the results. Perhaps make the second app not visible in the launcher and somehow distribute the two apps together.
Since I am not experienced with android development and especially xamarin and I don't have a lot of time to waste on this project I want to know if my idea is feasible or if there is a better alternative.
Can you suggest some useful tutorials for xamarin and using dlls with it?
===============================================
Edit
I have managed to get the source code of the dll project which is in C++ (and full of windows only stuff) and now I'm trying to use NDK to compile it and JNI with Android studio to use the native functions. Unfortunately almost every step has it's own quirks and problems and it's far from smooth :/ I wouldn't recommend it to beginners like me!
I know this answer is late, but I'm in a similar situation right now.
This project here helped me setup a native Android Studio build with an embedded C# lib:
https://github.com/royd/KotlinAppWithXamarinDependency
The only issue I'm facing right now, that I can't get the R8 obfuscation/optimization to work without breaking the app.

Categories