.NET integration: Vuzix on MAUI
What we'll try to achieve
We'll build an integration in MAUI that will hide all the complexity doing interfacing work on Android - and perhaps in a later stage on IOS as well.
Microsoft MAUI is a way to build code in C# / .NET and run it on several devices. And builds upon Microsoft Blazor - the coding experience is the same. The resulting application is either a web application or service vs a Mobile application.
This means, you can build "a desktop app that runs on Android or IPhone IOS" without any change in the code. This works with running HTML code with asyncronous calls to an interpreter that runs on either system. All this complexity is handled for you - so either you code in your usual .NET environment or write some JavaScript that will "drive the device in the background".
Lets get started!
Set up the project
- Let's assume you've installed Visual Studio and checked the "mobile development" option (or have added this featureset
- Create a new MAUI Blazor Hybrid project
- Click through the options and you'll see the folder structure.
The folder "Platforms" contains code specific for the target system, in this guide, we'll only focus on Android for simplicity.
- So lets right-click the project, to edit the project file
- Remove the targets we don't use right now
- We also need to set the minimum version to 30 for Android
Add the Nuget package
It is possible to create this project yourself - but I have taken the liberty to make a nuget package for it. (the generator requires some manual editting that is cumbersome, so a package will be easier)
Application first run
If everything is setup properly, you should be able to select your target to deploy (or emulate) the application on.
If you've installed the USB drivers with Android studio, you should be able to put your Android phone in Debug-mode and run the application on your physical real phone.
You should now see your emulator running with your MAUI application that is set up to work with Vuzix Z100!