Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CodexaCP/DG_APK/llms.txt

Use this file to discover all available pages before exploring further.

Dragon Guard Handheld targets net8.0-android as its active framework. The project uses conditional compilation (#if DEBUG, #if ANDROID) to switch between a test-friendly debug experience and a locked-down official release. This page covers how builds are configured, how to produce a deployable APK, and what differs between the two modes.

Target Framework

The active build target is net8.0-android (Android API 21 minimum, no upper bound set):
Handheld.csproj
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
<ApplicationId>com.mycompany.myapp</ApplicationId>
The csproj previously listed iOS, MacCatalyst, Windows, and Tizen as additional targets but they have been removed. Only net8.0-android is actively tested and supported.

Build Commands

dotnet publish -f net8.0-android -c Release
The output APK is placed in bin/Release/net8.0-android/ (or Debug/).

Debug Build Configuration

When Configuration == Debug:
BehaviorDetail
Connection settings visibleAppExperienceService.ShowConnectionSettings = true
URL override allowedAppExperienceService.AllowConnectionOverride = true
Debug logging enabledbuilder.Logging.AddDebug() is called in MauiProgram.cs
ExperienceMode"TEST"
Assemblies embedded in APKEmbedAssembliesIntoApk = true (rugged device compatibility)
The EmbedAssembliesIntoApk flag is set explicitly for debug Android builds because rugged Android firmware can fail with MAUI’s fast deployment override assemblies:
Handheld.csproj
<PropertyGroup Condition="'$(Configuration)' == 'Debug' And $(TargetFramework.Contains('-android'))">
  <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>

Release Build Configuration

When Configuration == Release:
BehaviorDetail
Connection settings hiddenAppExperienceService.ShowConnectionSettings = false
URL override blockedAppExperienceService.AllowConnectionOverride = false
Saved test URL clearedRemoved from Preferences on startup
Debug logging disabledbuilder.Logging.AddDebug() not called
ExperienceMode"OFFICIAL"
AppExperienceService.cs
#if DEBUG
    public bool ShowConnectionSettings => true;
    public bool AllowConnectionOverride => true;
    public string ExperienceMode => "TEST";
#else
    public bool ShowConnectionSettings => false;
    public bool AllowConnectionOverride => false;
    public string ExperienceMode => "OFFICIAL";
#endif
Never ship a DEBUG build as an official release. DEBUG builds expose connection settings and allow operators to redirect the app to arbitrary servers.

Android-Specific Code Paths

Several code paths are Android-only, guarded by #if ANDROID: SocketsHttpHandler — All HTTP clients use SocketsHttpHandler on Android instead of the default MAUI handler:
MauiProgram.cs
#if ANDROID
    .ConfigurePrimaryHttpMessageHandler(CreateAndroidHandler)
#endif

private static HttpMessageHandler CreateAndroidHandler()
{
    return new SocketsHttpHandler();
}
VendorRfidScanAdapter — The vendor RFID SDK integration lives in Platforms/Android/Scanning/VendorRfidScanAdapter.cs and is only compiled for Android. AndroidKeyboardWedge — Keyboard wedge barcode input handling lives in Platforms/Android/Scanning/AndroidKeyboardWedge.cs.

Shell Navigation Excluded

AppShell.xaml is explicitly removed from compilation because it crashes on rugged Android (broken fragment startup in some OEM firmware):
Handheld.csproj
<MauiXaml Remove="AppShell.xaml" />
<Compile Remove="AppShell.xaml.cs" />
Do not re-enable Shell navigation. The app uses NavigationPage with NavigationService as the navigation root, set in App.xaml.cs. Shell crashes on target rugged Android devices.

Android Manifest Permissions

The manifest (Platforms/Android/AndroidManifest.xml) declares:
PermissionPurpose
INTERNETHTTP calls to the Dragon Guard backend
ACCESS_NETWORK_STATEUsed by DeviceIdentityService to read WiFi MAC address
The application element sets android:usesCleartextTraffic="true" and references the network security config for HTTP dev server access.

Vendor RFID SDK (AAR Binding)

The RFID hardware SDK is included as an Android Archive:
Handheld.csproj
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
  <AndroidAarLibrary Include="Platforms\Android\Bindings\DeviceAPI_ver20250209_release.aar" />
</ItemGroup>
This AAR is bound at compile time. Classes from the vendor SDK are called through VendorRfidScanAdapter.cs.

NuGet Dependencies

The project has a minimal dependency footprint:
PackageVersionPurpose
Microsoft.Maui.Controls$(MauiVersion)MAUI framework
Microsoft.Extensions.Http8.0.1IHttpClientFactory
Microsoft.Extensions.Logging.Debug8.0.1Debug log output

Build docs developers (and LLMs) love