Back to results for “Android”
.NET MAUI › Native Interop & Libraries

How do you call a native Android library (Java/Kotlin) from MAUI?

Intermediate

Answer

Use a .NET for Android binding library that projects the Java/Kotlin AAR or JAR into C# through a bindings project, then reference it from Platforms/Android code. Microsoft provides binding tooling and metadata transforms to fix API surface issues.
// In an Android bindings project, reference the .aar,
// then call the generated C# API from Platforms/Android.
var client = new Com.Vendor.Sdk.Client(context);
Real-world example A payment SDK shipped only as an Android AAR is consumed by generating a C# binding and calling it from Android-specific code.

Common follow-ups: What is a bindings project? | How do you fix a broken generated API?