Skip to main content

.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
  1. Let's assume you've installed Visual Studio and checked the "mobile development" option (or have added this featureset
    image.png

  2. Create a new MAUI Blazor Hybrid  project

    image.png




  3. 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.

    image.png


  4. So lets right-click the project, to edit the project file


    image.png


  5. Remove the targets we don't use right now

    image.png


  6. We also need to set the minimum version to 30 for Android

    image.png


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)

  1. Open nuget package manager

    image.png
  2. Find the nuget package and add it to the project

    image.png


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.

image.png


You should now see your emulator running with your MAUI application that is set up to work with Vuzix Z100!

image.png

Continue to the next page, to start contacting your glasses.