Java 我可以在 Android Dalvik 上使用哪些编程语言?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1994703/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:14:46  来源:igfitidea点击:

Which programming languages can I use on Android Dalvik?

javapythonandroidscaladalvik

提问by mjn

In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of

理论上,Dalvik 可以执行任何虚拟机字节码,例如使用以下编译器创建的

  • AspectJ
  • ColdFusion
  • Clojure
  • Groovy
  • JavaFX Script
  • JRuby
  • Jython
  • Rhino
  • Scala
  • 方面J
  • 冷聚变
  • Clojure
  • 常规
  • JavaFX 脚本
  • 红宝石
  • Jython
  • 犀牛
  • 斯卡拉

Are there already working versions of bytecode compilers for Dalvik available for other languages than Java?

是否已经有适用于 Java 以外的其他语言的 Dalvik 字节码编译器的工作版本?

采纳答案by Paresh Mayani

  • At launch, Javawas the only officially supported programming language for building distributable third-party Android software.

  • Android Native Development Kit (Android NDK) which will allow developers to build Android software components with Cand C++.

  • In addition to delivering support for native code, Google is also extending Android to support popular dynamic scripting languages. Earlier this month, Google launched the Android Scripting Environment (ASE) which allows third-party developers to build simple Android applications with perl, JRuby, Python, LUAand BeanShell. For having idea and usage of ASE, refer this Example link.

  • Scala is also supported. For having examples of Scala, refer these Example link-1, Example link-2, Example link-3.

  • Just now i have referred one Article Here in which i found some useful information as follows:

    1. programming language is Java but bridges from other languages exist (C# .net - Mono, etc).
    2. can run script languages like LUA, Perl, Python, BeanShell, etc.

  • I have read 2nd article at Google Releases 'Simple' Android Programming Language . For example of this, refer this .

  • Just now (2 Aug 2010) i have read an article which describes regarding "Frink Programming language and Calculating Tool for Android", refer this links Link-1, Link-2

  • On 4-Aug-2010, i have found Regarding RenderScript. Basically, It is said to be a C-like language for high performance graphics programming, which helps you easily write efficient Visual effects and animations in your Android Applications. Its not released yet as it isn't finished.

  • 在发布时,它Java是唯一官方支持的用于构建可分发的第三方 Android 软件的编程语言。

  • Android 原生开发工具包 (Android NDK),它允许开发人员使用CC++.

  • 除了提供对本机代码的支持外,Google 还扩展了 Android 以支持流行的动态脚本语言。本月初,谷歌推出了 Android的脚本环境(ASE) ,它允许第三方开发人员构建简单的Android应用程序有perlJRubyPythonLUABeanShell。有关ASE 的想法和用法,请参阅此示例链接

  • 也支持Scala。有关 Scala 的示例,请参阅这些Example link-1Example link-2Example link-3

  • 刚才我参考了一篇文章在这里,我在其中找到了一些有用的信息,如下所示:

    1. 编程语言是 Java,但存在其他语言的桥梁(C# .net - Mono, etc)
    2. 可以运行的脚本语言,如LUAPerlPythonBeanShell,等。

  • 我已经阅读了Google Releases 'Simple' Android Programming Language 上的第二篇文章。例如,请参阅此

  • 刚刚(2010 年 8 月 2 日)我读了一篇文章,其中描述了“ Frink 编程语言和 Android 计算工具”,请参阅此链接Link-1, Link-2

  • 2010 年 8 月 4 日,我发现了关于RenderScript. 基本上,它是一种用于高性能图形编程的类 C 语言,可帮助您在 Android 应用程序中轻松编写高效的视觉效果和动画。由于尚未完成,因此尚未发布。

回答by miloshadzic

I haven't played with it but I know that Scala works.

我没有玩过它,但我知道 Scala 有效。

http://www.scala-lang.org/node/160

http://www.scala-lang.org/node/160

回答by Brian Hsu

Scala works very well.

Scala 工作得很好。

I'm programming my Android application projects in Scala (Website written in Chinese with some screenshot, source code @ GitHub), and it is pretty easy to setup the evnviroment (without IDE, using SBT as build tool).

我正在 Scala 中编写我的 Android 应用程序项目(用中文编写的网站,带有一些屏幕截图源代码@GitHub),并且设置环境环境非常容易(没有 IDE,使用 SBT 作为构建工具)。

It could access every API in Android SDK, so anything you could do in Java, you could do it in Scala too.

它可以访问 Android SDK 中的每个 API,所以你可以在 Java 中做的任何事情,你也可以在 Scala 中做。

You may check this blog entryto see how to build Android application with Scala and SBT.

您可以查看此博客条目以了解如何使用 Scala 和 SBT 构建 Android 应用程序。

回答by Jeff Gilfelt

The dynamically typed languages wont be possible until Dalvik supports JIT (Just In Time) compiling. I believe there is JIT support in one of the experimental Eclair branches, but it is not yet officially available/supported in Android.

在 Dalvik 支持 JIT(即时)编译之前,动态类型语言是不可能的。我相信在实验性 Eclair 分支之一中有 JIT 支持,但它尚未在 Android 中正式可用/支持。

回答by Julian Fondren

Mercuryalso works on Android, using its Java backend. I've written a simple appthat should help someone get started (there are still few other examples), and mercury-android-helperalso for this purpose (although at this exact moment, it's short a few commits. And neither are using ProGuard yet, so the .apksize is shocking.)

Mercury也适用于 Android,使用其 Java 后端。我写了一个简单的应用程序,应该可以帮助某人开始(还有其他几个例子),并且Mercury-android-helper也用于这个目的(尽管在这个确切的时刻,它只是一些提交。而且都没有使用 ProGuard然而,所以.apk大小令人震惊。)

Although the other posts here are cheerful about Scala-on-Android, posters in Scala forums are more concerned by Scala's ability to blow through some of Dalvik's limitations, and people who do use it say they reserve it for non-production code. (Some discussion about Scala's problems here.)

尽管这里的其他帖子都对 Scala-on-Android 表示欢呼,但 Scala 论坛中的海报更关注 Scala 突破 Dalvik 某些局限性的能力,并且确实使用它的人表示他们将其保留用于非生产代码。(约Scala的一些讨论的问题在这里。)

I can't say yet if Mercury has its own problems with Dalvik, but I've switched to it from Scala for the time being.

我还不能说 Mercury 是否有自己的 Dalvik 问题,但我暂时从 Scala 切换到它。

回答by bug

Kawais a lovely but little known variant of Scheme that has existed quietly for many years and runs on both the JVM and Dalvik, natively. Therefore, its output includes no extra VM and only includes explicitly imported libraries. To the end-programmer, this means Kawa's performance and executable size are nearly identical to standard Java (ProGuard not required).

Kawa是 Scheme 的一个可爱但鲜为人知的变体,它已经悄然存在多年,并且在 JVM 和 Dalvik 上运行,原生。因此,它的输出不包含额外的 VM,只包含显式导入的库。对于最终程序员来说,这意味着 Kawa 的性能和可执行文件大小几乎与标准 Java 相同(不需要 ProGuard)。

Kawa also includes lots of macros (including some specific to Android APIs) that make for a nice clean syntax (assuming one is not averse to parentheses), and adds some tasty goodies on top of Scheme, like "promises" (lazy eval and futures in one). The language is quite robust and well-documented, and has been actively maintained and evolving since the early days of Java.

Kawa 还包含许多宏(包括一些特定于 Android API 的宏),它们提供了一个很好的干净语法(假设一个不反对括号),并在 Scheme 之上添加了一些美味的东西,比如“promises”(懒惰的 eval 和 futures在一个)。该语言非常健壮且文档齐全,并且自 Java 早期以来一直在积极维护和发展。

The Java Advent Calendarsummarizes Kawa's merits with some informative examples and links.

Java Advent Calendar通过一些信息丰富的示例和链接总结了 Kawa 的优点。

回答by Thomas

Another JVM language that works on Android is Kotlinwith Anko, both from Jetbrains.

另一种适用于 Android 的 JVM 语言是KotlinAnko,均来自Jetbrains

回答by Ion Vladescu

1) Angular + nativeScript

1) Angular + nativeScript

2) Reactnative

2)反应性