Java 哪些编程语言可用于在 Android 中进行开发?

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

Which programming languages can be used to develop in Android?

javaandroidscalaprogramming-languagesscripting

提问by RoflcoptrException

Possible Duplicate:
Which programming languages can I use on Android Dalvik?

可能的重复:
我可以在 Android Dalvik 上使用哪些编程语言?

Mostly, Android applications are written in Java. But i heard that its also possible to use Scala or some other languages. And I also read that it's possible to include native C/C++ code.

大多数情况下,Android 应用程序是用 Java 编写的。但我听说它也可以使用 Scala 或其他一些语言。我还了解到可以包含本机 C/C++ 代码。

Is there a refernce/list available that shows which languages can be used?

是否有可用的参考/列表显示可以使用哪些语言?

采纳答案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 amra

Scala is supported. See example.

支持Scala 。参见示例

Support for other languages is problematic:

对其他语言的支持是有问题的

7) Something like the dx tool can be forced into the phone, so that Java code could in principle continue to generate bytecodes, yet have them be translated into a VM-runnable form. But, at present, Java code cannot be generated on the fly. This means Dalvik cannot run dynamic languages (JRuby, Jython, Groovy). Yet. (Perhaps the dex format needs a detuned variant which can be easily generated from bytecodes.)

7) 可以将 dx 工具之类的东西强加到手机中,这样 Java 代码原则上可以继续生成字节码,但可以将它们转换为 VM 可运行的形式。但是,目前无法即时生成 Java 代码。这意味着 Dalvik 不能运行动态语言(JRuby、Jython、Groovy)。然而。(也许 dex 格式需要一个可以从字节码轻松生成的解调变体。)

回答by mhshams

Java and C:

Java和C:

  • C used for low level functionalities and device connectivities
  • Java used for Framework and Application Level
  • C 用于低级功能和设备连接
  • 用于框架和应用程序级别的 Java

You may find more information in Android developers site.

您可以在 Android 开发者站点中找到更多信息。

回答by jqno

Clojurecan be used, but it's slow.

可以使用Clojure,但是速度很慢。

See also: Clojure fork for Android, and a tutorial.

另请参阅:Clojure fork for Android教程

回答by nuriaion

I made good experiences with Scala.

我在 Scala 方面取得了很好的经验。

I use the simple build tool (sbt: http://code.google.com/p/simple-build-tool/) with the Android-Plugin (http://github.com/jberkel/android-plugin)

我使用简单的构建工具(sbt:http: //code.google.com/p/simple-build-tool/)和 Android 插件(http://github.com/jberkel/android-plugin

回答by inquam

As stated above, many languages are available for developing in Android. Java, C, Scala, C++, several scripting languages etc. Thanks to Mono you are also able to develop using C# and the .Net framework. Here you have some speedcomparisions: http://www.youtube.com/watch?v=It8xPqkKxis

如上所述,许多语言可用于在 Android 中进行开发。Java、C、Scala、C++、多种脚本语言等。感谢 Mono,您还可以使用 C# 和 .Net 框架进行开发。这里有一些速度比较:http: //www.youtube.com/watch?v =It8xPqkKxis

回答by Seth

Here's a list of languages that can be used to develop on android:

以下是可用于在 android 上进行开发的语言列表:

  • Java - primary android development language

  • Kotlin, language from JetBrains which received first-party support from Google, announced in Google I/O 2017

  • C++ - NDKfor libraries, not apps

  • Python, bash, et. al. - Via the Scripting Environment

  • Corona- One is to use the Corona SDK . Corona is a high level SDK built on the Lua programming language. Lua is much simpler to learn than Java and the SDK takes away a lot of the pain in developing Android app.

  • Cordova- which uses HTML5, JavaScript, CSS, and can be extended with Java

  • Xamarin technology - that uses c# and in which mono is used for that. Here MonoTouch and Mono for Android are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications.

  • Java - 主要的安卓开发语言

  • Kotlin,来自 JetBrains 的语言,获得了谷歌的第一方支持,在谷歌 I/O 2017 上宣布

  • C++ -用于库而非应用程序的NDK

  • Python、bash 等。阿尔。- 通过脚本环境

  • Corona- 一种是使用Corona SDK。Corona 是基于 Lua 编程语言构建的高级 SDK。Lua 比 Java 更容易学习,并且 SDK 消除了开发 Android 应用程序的很多痛苦。

  • Cordova- 使用 HTML5、JavaScript、CSS,并且可以使用 Java 进行扩展

  • Xamarin 技术- 使用 c# 并在其中使用单声道。这里的 MonoTouch 和 Mono for Android 是通用语言基础设施 (CLI) 和通用语言规范的跨平台实现。

As for your second question: android is highly dependent on it's java architecture, I find it unlikely that there will be other primary development languages available any time soon. However, there's no particular reason why someone couldn't implement another language in Java(something like Jython) and use that. However, that surely won't be easier or as performant as just writing the code in Java.

至于你的第二个问题:android 高度依赖于它的 java 架构,我发现很快就会有其他主要的开发语言可用。然而,没有什么特别的理由为什么有人不能在 Java 中实现另一种语言(比如 Jython)并使用它。但是,这肯定不会像只用 Java 编写代码那样简单或高效。