Mono for Android是需要在Android设备上安装的框架,还是可以编译为Java字节码的编译器? [英] Mono for Android is a framework that need to be installed on android devices or is a compiler that compiles to java bytecode?

查看:114
本文介绍了Mono for Android是需要在Android设备上安装的框架,还是可以编译为Java字节码的编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解Android单声道的工作原理,但在官方网站上找不到此解释.

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

考虑到android读取Java字节码,Mono for Android是需要在android设备上安装的框架,还是编译为Java字节码的编译器?

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?

推荐答案

本文Xamarin网站上的描述了该体系结构是如何组合在一起的.

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

长话短说,没有什么可以将C#编译为Java字节码.适用于Android应用程序的Mono内嵌了Mono运行时,该运行时与Dalvik(Android的Java虚拟机)并行运行. Mono运行时使用可调用包装器,以便于在需要时与Dalvik进行来回通信,但是.NET对象直接向Mono运行时(而不是Dalvik)说话.

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.

为加快开发速度,将调试模式下的应用程序设置为使用共享的运行时来减少部署时间,并允许多个应用程序共享同一运行时.但是,在发布模式下编译的应用程序不支持此功能,因此,您发布和分发的任何应用程序都将包含其自己的嵌入式Mono运行时,并且不会依赖于其他任何内容.

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.

这篇关于Mono for Android是需要在Android设备上安装的框架,还是可以编译为Java字节码的编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆