Google Android 会支持 .NET 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/214615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Will Google Android ever support .NET?
提问by JarrettV
Now that the G1 with Google's Android OS is now available (soon), will the android platform ever support .Net?
既然采用 Google 的 Android 操作系统的 G1 现已上市(很快),那么 android 平台会支持 .Net 吗?
回答by miguel.de.icaza
Update: Since I wrote this answer two years ago, we productized Mono to run on Android. The work included a few steps: porting Mono to Android, integrating it with Visual Studio, building plugins for MonoDevelop on Mac and Windows and exposing the Java Android APIs to .NET languages. This is now available at http://monodroid.net
更新:自从我两年前写了这个答案,我们将 Mono 产品化以在 Android 上运行。这项工作包括几个步骤:将 Mono 移植到 Android,将其与 Visual Studio 集成,为 Mac 和 Windows 上的 MonoDevelop 构建插件以及将 Java Android API 公开给 .NET 语言。这现在可以在http://monodroid.net 上找到
- Getting Started: http://monodroid.net/Welcome
- Documentation: http://monodroid.net/Documentation
- Tutorials: http://monodroid.net/Tutorials
- 入门:http: //monodroid.net/Welcome
- 文档:http: //monodroid.net/Documentation
- 教程:http: //monodroid.net/Tutorials
Mono on Android is based on the Mono 2.10 runtime, and defaults to 4.0 profile with the C# 4.0 compiler and uses Mono's new SGen garbage collection engine, as well as our new distributed garbage collection system that performs GC across Java and Mono.
Android 上的 Mono 基于 Mono 2.10 运行时,使用 C# 4.0 编译器默认为 4.0 配置文件,并使用 Mono 新的 SGen 垃圾收集引擎,以及我们新的分布式垃圾收集系统,该系统在 Java 和 Mono 之间执行 GC。
The links below reflect Mono on Android as of January of 2009, I have kept them for historical context
以下链接反映了截至 2009 年 1 月 Android 上的 Mono,我将它们保留为历史背景
Mono now works on Android thanks to the work of Koushik Dutta and Marc Crichton.
由于 Koushik Dutta 和 Marc Crichton 的工作,Mono 现在可以在 Android 上运行。
You can see a video of it running here: http://www.koushikdutta.com/2009/01/mono-on-android-with-gratuitous-shaky.html
你可以在这里看到它运行的视频:http: //www.koushikdutta.com/2009/01/mono-on-android-with-gratuitous-shaky.html
And you can get the instructions to build Mono yourself here: http://www.koushikdutta.com/2009/01/building-mono-for-android.html
您可以在此处获得自行构建 Mono 的说明:http: //www.koushikdutta.com/2009/01/building-mono-for-android.html
You can get a benchmark comparing Mono's JIT vs Dalvik's interpreter here: http://www.koushikdutta.com/2009/01/dalvik-vs-mono.html
您可以在此处获得比较 Mono 的 JIT 与 Dalvik 的解释器的基准:http: //www.koushikdutta.com/2009/01/dalvik-vs-mono.html
And of course, you can get a pre-configured image with Mono here (go to the bottom of the post for details on using that): http://www.koushikdutta.com/2009/01/building-mono-for-android.html
当然,您可以在此处使用 Mono 获得预配置的图像(有关使用的详细信息,请转到文章底部):http: //www.koushikdutta.com/2009/01/building-mono-for- android.html
回答by lubos hasko
Yes, it will be possible and it won't be that difficult. All what's needed at this point to start with is some kind of converter that will turn MSIL into Dalvik bytecode. Since both formats are open-sourced and well documented, there won't be any problem with it.
是的,这将是可能的,而且不会那么困难。此时开始需要的是某种转换器,可以将 MSIL 转换为Dalvik 字节码。由于这两种格式都是开源的并且文档齐全,因此不会有任何问题。
So, writing Android applications in C# or VB.NET will be possible, question is how much of .NET framework standard libraries will be supported. But that's another issue.
因此,使用 C# 或 VB.NET 编写 Android 应用程序将成为可能,问题是将支持多少 .NET 框架标准库。但这是另一个问题。
Oscar Reyes wrote:
I'm pretty sure if google hand ANY interest in .net, they would've design something while Android was in the first stages, not now when they are in production stages. I don't mean it is not possible, what I'm saying is they're not interested. Maybe in mmm hhhh 10 yrs.
奥斯卡雷耶斯写道:
我很确定如果谷歌对 .net 有任何兴趣,他们会在 Android 处于第一阶段时设计一些东西,而不是现在当他们处于生产阶段时。我并不是说这是不可能的,我是说他们不感兴趣。也许在 mmm hhhh 10 年。
Actually what they've already designed is very compatiblewith Java and .NET
实际上他们已经设计的与 Java 和 .NET非常兼容
They can't do everything at once, but if you look into Android SDK, there is a tool called dx. This tool converts Java bytecode into Dalvik bytecode, so in other words, you can run programs written in Java on Android with no effort today. Now the same tool is needed for .NET.
他们不能同时做所有事情,但是如果您查看 Android SDK,就会发现一个名为dx的工具。该工具将 Java 字节码转换为 Dalvik 字节码,也就是说,您今天可以毫不费力地在 Android 上运行用 Java 编写的程序。现在 .NET 需要相同的工具。
Considering how similar .NET and Java are, it's really a matter of time.
考虑到 .NET 和 Java 有多么相似,这真的是时间问题。
ddimitrov wrote:
The .Net->Java->Dalvik translation can be done even now (http://dev.mainsoft.com/), but I think you underestimate the lack of .Net libraries. Of course somebody can port Mono, but it's definitely a non-trivial effort.
德迪米特洛夫写道:
.Net->Java->Dalvik 翻译现在可以完成(http://dev.mainsoft.com/),但我认为你低估了 .Net 库的缺乏。当然,有人可以移植 Mono,但这绝对是一项重要的工作。
No need to port Mono. Android already has VM and some basic API. All what's needed is CIL->Dalvik converter and tiny .NET wrapper for Android API (and maybe some basic implementation of some standard .NET classes). That's it.
无需移植 Mono。Android 已经有 VM 和一些基本的 API。所需要的只是 CIL->Dalvik 转换器和用于 Android API 的微型 .NET 包装器(可能还有一些标准 .NET 类的一些基本实现)。就是这样。
Update:.NET already works on Android - you will need product called Monodroid (http://monodroid.net) as stated above.
更新:.NET 已经可以在 Android 上运行了 - 您需要如上所述的名为 Monodroid ( http://monodroid.net) 的产品。
回答by trampster
Miguel de Icaza's announced on his blogon the 17th of Feb 2010 that they are starting work on mono for android which will be called MonoDroid.
Miguel de Icaza 于2010 年 2 月 17 日在他的博客上宣布,他们正在开始为 android 开发单声道,将被称为 MonoDroid。
This will be similar to MonoTouch on the iphone but for android instead.
这将类似于 iPhone 上的 MonoTouch,但适用于 android。
It will provide binding to the android UI, so apps will look and feel live native android apps. This will require you to write an android specific UI.
它将提供对 android UI 的绑定,因此应用程序的外观和感觉就像是原生的 android 应用程序。这将要求您编写一个 android 特定的 UI。
You will however be able to reuse you existing lower level libraries without the need to recompile.
但是,您将能够重用现有的较低级别的库,而无需重新编译。
回答by Tony
Since this is one of the first links on Google when search for Android and .net support, it is only fitting to post this here.
由于这是搜索 Android 和 .net 支持时 Google 上的第一个链接之一,因此只适合在此处发布。
The mono project is working on a SDK to develop Android applications using CIL languages such as C#. The down side is it will be a commercial product. monodroid
Mono 项目正在开发一个 SDK,以使用 C# 等 CIL 语言开发 Android 应用程序。不利的一面是它将是一种商业产品。独角兽
回答by MonoDroid
There is Mono for Android, the .NET framework ported for Android. And there is MonoDroid, a development stack for using C# and the core .NET APIs to develop Android-based applications. MonoDroid Preview 1 has been released a couple of days ago.
有适用于 Android 的 Mono,这是为 Android 移植的 .NET 框架。还有 MonoDroid,这是一个使用 C# 和核心 .NET API 来开发基于 Android 的应用程序的开发堆栈。MonoDroid Preview 1 已于几天前发布。
回答by GSree
MonoDroid is awailable for preview. I think that will bridge the gap. However, MonoDroid could be a costly option for development. Their other development tools costs anywhere between $199 and $4000 (The MonoTouch .. iPhone dev tool ... is priced between $399 and $3999). If people develop apps with these tools, they need a very strong business model to see some returns.
MonoDroid 可供预览。我认为这将弥合差距。然而,MonoDroid 可能是一个昂贵的开发选择。他们的其他开发工具的价格在 199 美元到 4000 美元之间(MonoTouch .. iPhone 开发工具......价格在 399 美元到 3999 美元之间)。如果人们使用这些工具开发应用程序,他们需要一个非常强大的商业模式才能看到一些回报。
回答by Poorna
回答by KevinD
.NET compact framework has been ported to Symbian OS (http://www.redfivelabs.com/). If .NET as a 'closed' platform can be ported to this platform, I can't see any reason why it cannot be done for Android.
.NET 紧凑型框架已移植到 Symbian OS ( http://www.redfivelabs.com/)。如果 .NET 作为“封闭”平台可以移植到这个平台,我看不出有什么理由不能为 Android 完成。
回答by Peter
.NET and Mono are great environments, with many tools and and excellent skills base of people who know how to use them.
.NET 和 Mono 是很棒的环境,有许多工具和优秀的技能基础,并且知道如何使用它们。
I think Mono has the opportunity to be the mobile cross-platform development environment of choice, seeing as they are the only alternative to Objective-C on the iPhone and should be portable to Android, and .NET is already on Windows Mobile.
我认为 Mono 有机会成为首选的移动跨平台开发环境,因为它们是 iPhone 上 Objective-C 的唯一替代品,并且应该可以移植到 Android,而 .NET 已经在 Windows Mobile 上。
I'm really hoping to see a solid implementation of Mono on Android, with wrappers for the Android API as with Monotouch, and would be prepared to pay for it since I'm not in a position to do it myself.
我真的很希望在 Android 上看到 Mono 的可靠实现,像使用 Monotouch 一样使用 Android API 的包装器,并且准备支付它,因为我自己无法做到这一点。