Skip to content

[release/13.0] MAUI Integration Android + OtlpDevTunnel#12762

Closed
jfversluis wants to merge 15 commits into
release/13.0from
jfversluis/maui-android-release
Closed

[release/13.0] MAUI Integration Android + OtlpDevTunnel#12762
jfversluis wants to merge 15 commits into
release/13.0from
jfversluis/maui-android-release

Conversation

@jfversluis

@jfversluis jfversluis commented Nov 6, 2025

Copy link
Copy Markdown
Member

#12381 but targeting release

Customer Impact

Customers are now able to also use Android for the MAUI integration. Next to Windows and macOS that is already merged. This (the Android platform integration) is currently not available, so no risk for regressions or anything else, just that the first experience might be rough, but the happy path will definitely work and we can take in customer feedback this way.

Testing

Current tests are unchanged and all passing, @maddymontaquila will do some manual testing.

Risk

Low, new package, will be released as preview, if it doesn't work thats not great but also not disastrous

Regression?

N/A

jfversluis and others added 14 commits November 6, 2025 19:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Simplifies MauiAndroidEnvironmentProcessedAnnotation by removing the unused TargetsFilePath property and constructor. Updates usage to reflect the new parameterless constructor and clarifies documentation to indicate the annotation is a marker for callback registration.
Replaces hardcoded default OTLP port and URL values with named constants and static readonly fields for improved maintainability and clarity.
Copilot AI review requested due to automatic review settings November 6, 2025 18:38
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12762

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12762"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Android platform support (device and emulator) to the Aspire MAUI hosting integration, consolidates platform-specific tests to reduce duplication, and introduces dev tunnel support for OpenTelemetry connectivity on mobile platforms.

Key changes:

  • Adds MauiAndroidDeviceResource and MauiAndroidEmulatorResource with full extension methods for adding Android targets to MAUI projects
  • Implements environment variable forwarding for Android via MSBuild targets files (required due to Android platform limitations)
  • Creates shared OTLP dev tunnel infrastructure (WithOtlpDevTunnel()) for mobile platforms that cannot reach localhost
  • Consolidates platform extension tests into a single theory-based test file using PlatformTestConfig

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
MauiPlatformExtensionsTests.cs New consolidated test file replacing separate platform test files using theory-based testing
MauiWindowsExtensionsTests.cs Deleted - tests moved to consolidated file
MauiMacCatalystExtensionsTests.cs Deleted - tests moved to consolidated file
MauiAndroidExtensions.cs New Android device/emulator extension methods with comprehensive documentation
MauiAndroidDeviceResource.cs New resource class for Android physical devices
MauiAndroidEmulatorResource.cs New resource class for Android emulators
MauiAndroidEnvironmentAnnotation.cs Subscriber and annotations for Android environment variable handling via MSBuild
MauiEnvironmentHelper.cs Utility for generating MSBuild targets files for Android environment variables
MauiOtlpExtensions.cs New WithOtlpDevTunnel() extension for mobile OTLP connectivity
OtlpEndpointResolver.cs Shared utility for resolving OTLP endpoint configuration
OtlpLoopbackResource.cs Synthetic resource for OTLP service discovery through dev tunnels
IMauiPlatformResource.cs Updated to extend IResourceWithParent<MauiProjectResource>
MauiWindowsPlatformResource.cs Simplified inheritance - removed redundant interface implementations
MauiMacCatalystPlatformResource.cs Simplified inheritance - removed redundant interface implementations
README.md (Aspire.Hosting.Maui) New comprehensive documentation for MAUI hosting package
README.md (playground) Updated with Android platform examples and environment variable documentation

Comment thread src/Aspire.Hosting.Maui/README.md
Comment thread src/Aspire.Hosting.Maui/README.md
Comment thread src/Aspire.Hosting.Maui/README.md
Comment thread src/Aspire.Hosting.Maui/README.md
Comment thread playground/AspireWithMaui/README.md
@joperezr

joperezr commented Nov 7, 2025

Copy link
Copy Markdown
Member

Assuming this was superseded by #12769

@jfversluis

Copy link
Copy Markdown
Member Author

Correct, closing

@jfversluis jfversluis closed this Nov 7, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants