Skip to content

About

C# MAUI binding library for Android built around Nordic Semiconductor's Android DFU Library

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

4 watching

Forks

Repository files navigation

Laerdal.Dfu.Bindings.Android

CI NuGet NuGet Downloads .NET License

A .NET MAUI/Xamarin binding library over Nordic Semiconductor's native Android DFU (Device Firmware Update) SDK, letting .NET code drive firmware updates on Nordic-based Bluetooth Low Energy devices over Android.

Native library wrapped: Android-DFU-Library (currently 2.11.0).

This package is a thin, largely 1:1 binding of Nordic's Java API — most consumers should use Laerdal.Dfu instead, which wraps this binding (plus its iOS/MacCatalyst counterpart) behind a single cross-platform C# API. Reach for this package directly only if you need the raw Nordic API surface without Laerdal.Dfu's abstraction.

Platform Support

Platform Supported
Android ✅ (API 21+)
Other ❌ — Android-only binding

Installation

dotnet add package Laerdal.Dfu.Bindings.Android

Building Locally

git clone https://github.com/Laerdal/Laerdal.Dfu.Bindings.Android.git
cd Laerdal.Dfu.Bindings.Android
dotnet build Laerdal.Dfu.Bindings.Android/Laerdal.Dfu.Bindings.Android.csproj

Requires the .NET MAUI Android workload (dotnet workload restore) and a JDK (CI uses 17). The build downloads Nordic's .aar and a matching Gson .jar straight from Maven Central during dotnet restore — no local gradle setup needed, despite this being a Java-library binding.

Known Issues

  • Xamarin.AndroidX.LocalBroadcastManager must stay an explicit dependency. Since the Android SDK 36 build-tools upgrade (~December 2025), omitting this pin causes "missing symbol" errors in consuming apps at build time, even though nothing in this binding's own Java sources changed — see PR #12.
  • The bundled Gson .jar is downloaded but deliberately excluded from binding/packaging (Laerdal.Dfu.Bindings.Android.csproj's AndroidLibrary/AndroidJavaLibrary Remove items) — Nordic's own .aar needs Gson on the classpath to compile against, but this project doesn't want to ship a full Gson C# binding alongside it. The csproj comment citing Android-DFU-Library#428 as the reason is likely a mislabeled reference — that issue is about an unrelated values.xml string-formatting build error, not Gson. The real history is closer to #218 (a long-since-fixed missing-Gson-in-POM issue from 2019), but that doesn't explain the exclusion either. Don't treat either issue number as authoritative without further digging; don't remove the exclusion without testing first.

License

BSD 3-Clause

About

C# MAUI binding library for Android built around Nordic Semiconductor's Android DFU Library

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors