ViceSharp.Host.Android
1.0.4
See the version list below for details.
dotnet add package ViceSharp.Host.Android --version 1.0.4
NuGet\Install-Package ViceSharp.Host.Android -Version 1.0.4
<PackageReference Include="ViceSharp.Host.Android" Version="1.0.4" />
<PackageVersion Include="ViceSharp.Host.Android" Version="1.0.4" />
<PackageReference Include="ViceSharp.Host.Android" />
paket add ViceSharp.Host.Android --version 1.0.4
#r "nuget: ViceSharp.Host.Android, 1.0.4"
#:package ViceSharp.Host.Android@1.0.4
#addin nuget:?package=ViceSharp.Host.Android&version=1.0.4
#tool nuget:?package=ViceSharp.Host.Android&version=1.0.4
ViceSharp.Host.Android
PLATFORM-CROSS-001 Android host shell for ViceSharp. This is a thin Avalonia
mobile head that reuses the shared App from ViceSharp.Avalonia; the
emulator core and UI live in the existing projects, not here.
Build prerequisites
By default this project targets net10.0-android. That requires:
.NET SDK 10.0.201 or newer (
global.jsonpins the rollForward channel).The
androidworkload:dotnet workload install androidOn Windows the workload pulls in the Microsoft.Android.Sdk pack (currently 36.x), which bundles the Android SDK, NDK, and an OpenJDK build under
C:\Program Files\Android/C:\Program Files (x86)\Android. The SDK target is API 36; the minimumSupportedOSPlatformVersionis 23 because the transitive AndroidX Lifecycle library used by Avalonia.Android requires it.(Device deploy only) An attached or emulated Android device and
adbonPATH. Workload installsadbunder the SDK platform-tools directory.
If the workload is missing the project falls back to plain net10.0 so the
solution stays buildable on any host:
dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj `
/p:ViceSharpHostAndroidFallback=true
In fallback mode the project compiles a desktop Avalonia exe instead of an APK. The fallback is solely for solution buildability; it is not a shipping target.
Build the APK
dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj `
-c Release
Output lands under
src/ViceSharp.Host.Android/bin/Release/net10.0-android/ as
org.vicesharp.host.android-Signed.apk (debug-signed by the build).
Deploy to a device
Enable USB debugging on the device.
Plug it in (or start an emulator with
emulator -avd <name>).From the repo root:
dotnet build src/ViceSharp.Host.Android/ViceSharp.Host.Android.csproj ` -t:Install -c ReleaseAlternative:
adb install bin/Release/.../*-Signed.apkafter a normal build.
Known gaps
- The shared
AppfromViceSharp.Avaloniacurrently only wires the classic desktop lifetime (IClassicDesktopStyleApplicationLifetime). On Android the lifetime isISingleViewApplicationLifetime; the host shell launches an empty surface until the sharedApplearns the mobile lifetime branch. That work is out of scope for the Phase 1 closeout scaffold. - The repo enables
IsAotCompatibleandEnableTrimAnalyzerglobally viaDirectory.Build.props. Avalonia.Android is not AOT/trim clean today, so this project opts out of those analyzers. Re-enable once Avalonia ships a clean profile.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Avalonia (>= 12.0.5)
- Avalonia.Desktop (>= 12.0.5)
- Avalonia.Fonts.Inter (>= 12.0.5)
- Avalonia.Themes.Fluent (>= 12.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.