Mono for Android is a framework that need to be installed on android devices or is a compiler that compiles to java bytecode?

二次信任 提交于 2020-01-04 08:06:05

问题


I'm trying to understand how mono for android works and I'm not found this explanation in official site.

Taking into account that android reads java bytecode, Mono for Android is a framework that need to be installed on android devices or is a compiler that compiles to java byte code?


回答1:


This article on Xamarin's site describes how the architecture is put together.

Long story short, there is nothing compiling C# into Java byte code. Mono for Android applications ship with the Mono runtime embedded in them, which runs side by side with Dalvik (Android's Java virtual machine). The Mono runtime uses callable wrappers in order to facilitate communicating back and forth with Dalvik when needed, but .NET objects talk right to the Mono runtime, rather than Dalvik.

To speed up development, apps in debug mode are set up to use a shared runtime to cut down on deployment time, and allowing multiple apps to share the same runtime. This isn't supported for applications compiled in release mode, though, so any app you release and distribute will contain its own embedded Mono runtime, and will not have a dependency on anything else.




回答2:


From this article

http://visualstudiomagazine.com/articles/2011/02/01/introducing-monodroid-intro.aspx/

MonoTouch creates a native application that contains the Mono runtime embedded within the application. MonoDroid can create two types of applications. The first is a single standalone application, which is similar to a MonoTouch application, with the app and the Mono runtime bound together. Everything that the application needs is embedded within the application. The second type is an application that makes use of a shared runtime that's installed on the device. This is similar to how .NET apps run on Windows. With this type of application, the app, along with other applications written with MonoDroid, can make use of a shared runtime.



来源:https://stackoverflow.com/questions/11633046/mono-for-android-is-a-framework-that-need-to-be-installed-on-android-devices-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!