Embedding .NET in Java
In some cases, you may want to add a Xamarin .NET library to an existing native Android project. To do this, you can use the Embeddinator-4000 tool to turn your .NET library into a native library that can be incorporated into a native Java-based Android app.
To use the Embeddinator-4000 with Java on Android, you will need the following:
Android Studio – Android Studio 3.x or later must be installed.
Xamarin.Android – Xamarin.Android 7.5 or later must be installed.
Java Developer Kit – Java 1.8 or later must be installed.
Mono – Mono 5.0 or later must be installed.
Using the Embeddinator-4000
To consume a .NET library in a native Android project, you use the following steps:
Create a C# Android Library project.
Install Embeddinator-4000 via NuGet.
Run Embeddinator on the Android library assembly.
Use the generated AAR file in a Java project in Android Studio.
These steps are described in detail in the Embeddinator-4000 documentation.