Android runtime through NDK #109746
-
If I understand correctly, at the moment Android applications are launched from the context of the Java virtual machine and, roughly speaking, C# is translated into Java. Is it possible to implement .NET Runtime via the Android NDK? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That's very rough simplification. Both MonoVM and NativeAOT runtimes are built on Android NDK and run as a separate virtual machine alongside Dalvik (the Java VM). C# is not translated to Java, it is translated to native code and run directly (either through JIT, interpreter or precompiled code). There's a Java interop layer on top of MonoVM that bridges the world of Java and .NET, the projection of the objects and garbage collection. It's implemented on top of Java Native Interface (JNI) with bits of Java code shipped in the runtime and bits of the interop generated when you compile the .NET Android app. Both MonoVM and NativeAOT runtimes are also shipped with |
Beta Was this translation helpful? Give feedback.
That's very rough simplification. Both MonoVM and NativeAOT runtimes are built on Android NDK and run as a separate virtual machine alongside Dalvik (the Java VM). C# is not translated to Java, it is translated to native code and run directly (either through JIT, interpreter or precompiled code).
There's a Java interop layer on top of MonoVM that bridges the world of Java and .NET, the projection of the objects and garbage collection. It's implemented on top of Java Native Interface (JNI) with bits of Java code shipped in the runtime and bits of the interop generated when you compile the .NET Android app.
Both MonoVM and NativeAOT runtimes are also shipped with
linux-bionic
variants witho…