NativeWebView.Platform.Android
0.1.0-alpha.1
dotnet add package NativeWebView.Platform.Android --version 0.1.0-alpha.1
NuGet\Install-Package NativeWebView.Platform.Android -Version 0.1.0-alpha.1
<PackageReference Include="NativeWebView.Platform.Android" Version="0.1.0-alpha.1" />
<PackageVersion Include="NativeWebView.Platform.Android" Version="0.1.0-alpha.1" />
<PackageReference Include="NativeWebView.Platform.Android" />
paket add NativeWebView.Platform.Android --version 0.1.0-alpha.1
#r "nuget: NativeWebView.Platform.Android, 0.1.0-alpha.1"
#:package NativeWebView.Platform.Android@0.1.0-alpha.1
#addin nuget:?package=NativeWebView.Platform.Android&version=0.1.0-alpha.1&prerelease
#tool nuget:?package=NativeWebView.Platform.Android&version=0.1.0-alpha.1&prerelease
NativeWebView
Native webview stack for Avalonia that stays on top of platform-native engines instead of bundling Chromium.
NuGet Packages
End-user installs are typically NativeWebView plus the platform package for the target runtime. NativeWebView.Dialog and NativeWebView.Auth are optional facades, while Core and Interop are primarily composition units and transitive dependencies.
Package Layout
| Package | Purpose |
|---|---|
NativeWebView |
Avalonia control facade API. |
NativeWebView.Core |
Shared contracts, controllers, feature model, and backend factory. |
NativeWebView.Dialog |
Dialog facade API. |
NativeWebView.Auth |
Web authentication broker facade API. |
NativeWebView.Interop |
Native handle contracts and structs. |
NativeWebView.Platform.Windows |
Windows backend registration and implementation. |
NativeWebView.Platform.macOS |
macOS backend registration and implementation. |
NativeWebView.Platform.Linux |
Linux backend registration and implementation. |
NativeWebView.Platform.iOS |
iOS backend registration and implementation. |
NativeWebView.Platform.Android |
Android backend registration and implementation. |
NativeWebView.Platform.Browser |
Browser backend registration and implementation. |
Features
NativeWebViewcontrol for embedded native browser surfaces inside Avalonia.NativeWebDialogfacade for dialog and popup browser workflows.WebAuthenticationBrokerfacade for OAuth and interactive sign-in.- Platform backends for Windows, macOS, Linux, iOS, Android, and Browser.
- Optional airspace-mitigation modes:
Embedded,GpuSurface, andOffscreen. - Diagnostics, capability reporting, render-frame export, integrity metadata, and smoke-testable sample apps.
Platform Support Matrix
| Platform | Embedded WebView | GPU Surface Mode | Offscreen Mode | Dialog | Authentication Broker | Native Handles |
|---|---|---|---|---|---|---|
| Windows | Yes | Yes | Yes | Yes | Yes | Yes |
| macOS | Yes | Yes | Yes | Yes | Yes | Yes |
| Linux | Yes | Yes | Yes | Yes | Yes | Yes |
| iOS | Yes | Yes | Yes | No | Yes | Yes |
| Android | Yes | Yes | Yes | No | Yes | Yes |
| Browser | Yes | Yes | Yes | No | Yes | Yes |
Installation
Install the Avalonia control package and the platform backend that matches the runtime you ship:
dotnet add package NativeWebView
dotnet add package NativeWebView.Platform.Windows
Optional packages:
dotnet add package NativeWebView.Dialogdotnet add package NativeWebView.Auth
Swap NativeWebView.Platform.Windows for NativeWebView.Platform.macOS, NativeWebView.Platform.Linux, NativeWebView.Platform.iOS, NativeWebView.Platform.Android, or NativeWebView.Platform.Browser as needed.
Quick Start
using NativeWebView.Controls;
using NativeWebView.Core;
using NativeWebView.Platform.Windows;
var factory = new NativeWebViewBackendFactory()
.UseNativeWebViewWindows();
if (!factory.TryCreateNativeWebViewBackend(NativeWebViewPlatform.Windows, out var backend))
{
throw new InvalidOperationException("Windows backend is not available.");
}
using var webView = new NativeWebView(backend);
await webView.InitializeAsync();
webView.RenderMode = NativeWebViewRenderMode.GpuSurface;
webView.RenderFramesPerSecond = 30;
webView.Navigate("https://example.com");
Rendering Modes
Embeddedkeeps the native child view hosted directly for maximum fidelity.GpuSurfacecaptures frames into a reusable Avalonia-backed surface.Offscreencaptures frames offscreen for fully managed composition paths.
Useful runtime APIs:
webView.SupportsRenderMode(mode)webView.IsUsingSyntheticFrameSourcewebView.RenderDiagnosticsMessagewebView.RenderStatisticsandwebView.GetRenderStatisticsSnapshot()webView.ResetRenderStatistics()await webView.CaptureRenderFrameAsync()await webView.SaveRenderFrameAsync("artifacts/frame.png")await webView.SaveRenderFrameWithMetadataAsync("artifacts/frame.png", "artifacts/frame.json")
Render sidecar metadata includes FrameId, CapturedAtUtc, RenderMode, Origin, PixelDataLength, and PixelDataSha256. Integrity verification requires matching FormatVersion.
Samples
Run the desktop feature explorer:
dotnet run --project samples/NativeWebView.Sample.Desktop/NativeWebView.Sample.Desktop.csproj -c Debug
Run the deterministic smoke matrix used by CI:
dotnet run --project samples/NativeWebView.Sample.Desktop/NativeWebView.Sample.Desktop.csproj -c Debug -- --smoke
Diagnostics and Release Validation
Runtime readiness check:
NativeWebViewRuntime.EnsureCurrentPlatformRegistered();
var diagnostics = NativeWebViewRuntime.GetCurrentPlatformDiagnostics();
if (!diagnostics.IsReady)
{
throw new InvalidOperationException(
$"Platform prerequisites are not satisfied for {diagnostics.Platform}.");
}
NativeWebViewDiagnosticsValidator.EnsureReady(diagnostics);
Generate release-facing diagnostics and gate artifacts:
./scripts/run-platform-diagnostics-report.sh --configuration Release --platform all --output artifacts/diagnostics/platform-diagnostics-report.json --markdown-output artifacts/diagnostics/platform-diagnostics-report.md --blocking-baseline ci/baselines/blocking-issues-baseline.txt --comparison-markdown-output artifacts/diagnostics/blocking-regression.md --comparison-json-output artifacts/diagnostics/blocking-regression.json --comparison-evaluation-markdown-output artifacts/diagnostics/gate-evaluation.md --require-baseline-sync --allow-not-ready
./scripts/validate-diagnostics-exit-code-contract.sh --configuration Release --no-build --output-dir artifacts/diagnostics/exit-code-contract --baseline ci/baselines/blocking-issues-baseline.txt --fingerprint-baseline ci/baselines/diagnostics-fingerprint-baseline.txt
./scripts/validate-nuget-packages.sh --package-dir artifacts/packages --markdown-output artifacts/packages/package-validation.md
blocking-regression.json includes deterministic evaluation fingerprints and structured gateFailures metadata for automation and release triage. Package validation verifies every .nupkg and .snupkg, packed README/license files, nuspec metadata, and expected package dependencies.
Documentation
- Hosted docs: wieslawsoltes.github.io/NativeWebVIew
- Getting started: Quickstart
- Control surface: NativeWebView
- Rendering and interop: Render Modes
- Platform notes: Platforms
- Diagnostics and operations: Diagnostics
- API reference: wieslawsoltes.github.io/NativeWebVIew/api
CI and Release
GitHub Actions workflows:
CI: quality gate, matrix build/test, release pack, diagnostics/report artifacts, and NuGet package validation.Release: tag-drivenv*pack/publish flow with release notes, diagnostics artifacts, package validation, NuGet push, and GitHub Release publishing.Docs: Lunet build and GitHub Pages deployment fromsite/.lunet/build/www.Extended Validation: scheduled/manual Playwright, iOS simulator, and Android emulator validation.
Local release dry run:
dotnet restore NativeWebView.sln
dotnet build NativeWebView.sln -c Release
dotnet test NativeWebView.sln -c Release --no-build
dotnet pack NativeWebView.sln -c Release --no-build -o artifacts/packages
bash ./scripts/validate-nuget-packages.sh --package-dir artifacts/packages --markdown-output artifacts/packages/package-validation.md
Local docs run:
./build-docs.sh
./serve-docs.sh
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- NativeWebView.Core (>= 0.1.0-alpha.1)
- NativeWebView.Interop (>= 0.1.0-alpha.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.1 | 27 | 3/10/2026 |