HelloWorldMaui sample application
The HelloWorldMaui sample application is a very simple MAUI application, consisting of a project that uses the Carmenta Engine MAUI MapControl.
When developing a .NET MAUI application, the .NET MAUI Extension methods.UseCarmentaEngine should be used to initialize Carmenta Engine.
Prerequisites
To build this sample, you need Visual Studio 2022 version 17.7 or later, with the MAUI features installed. The easiest way to install this is to add the workload .NET Multi-platform App UI development.
You also need a valid Carmenta Engine license key.
Building and running the sample
Unpack the HelloWorldMaui archive.
The sample includes a NuGet.config file that should set up the paths to find the required Carmenta Engine NuGet packages automatically. So you should be able to just open the solution in Visual Studio and run it when targeting Windows, or you can follow the instruction below to build for Android using the .NET SDK on Windows or Linux.
When targeting Android, a Carmenta Engine license key needs to be included in the project.
Locate your Carmenta Engine license key file on your PC (C:\ProgramData\Carmenta\License.carmentakey or /etc/Carmenta/License.carmentakey). Include it in your project so that it is located under Resources/Raw/carmenta.engine/data relative to the .csproj file.
To build the sample for Android without using Visual Studio, do the following:
Install Android Studio and the Android SDK.
Install the Android SDK platform for API level 33 in the Android SDK Manager (Tools > Open Android SDK Manager...).
In the HelloWorldMaui sample directory, run:
dotnet workload restore
dotnet build -c Release -p:AndroidSdkDirectory=[Path to the Android SDK directory]
The Path to the Android SDK directory should be replaced with the directory where the Android SDK is installed, typically ${HOME}/Android/Sdk on Linux and %LOCALAPPDATA%\Android\Sdk on Windows.
![]() |