VISUAL STUDIO   Windows Mac

Embedding .NET in Java

How to use a Xamarin .NET library in a Java-based Native Android Project

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-10

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.

Requirements

To use the Embeddinator-4000 with Java on Android, you will need the following:

You can use Visual Studio to edit and compile your C# code.

You can use Visual Studio for Mac to edit and compile your C# code.

Using the Embeddinator-4000

To consume a .NET library in a native Android project, you use the following steps:

  1. Create a C# Android Library project.

  2. Install Embeddinator-4000 via NuGet.

  3. Run Embeddinator on the Android library assembly.

  4. Use the generated AAR file in a Java project in Android Studio.

These steps are described in detail in the Embeddinator-4000 documentation.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.