Java或Python的(SL4A):与Android开始Python、Java、Android、SL4A

2023-09-04 09:07:37 作者:做个有出息的人‖

我刚刚订购的Andr​​oid智能手机,并希望开始创建自己的应用程序玩弄。现在的问题是要使用的语言,在本地Java或Python使用SL4A(原ASE)。

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).

我倾向于Python的,因为我知道它比Java好多了,但我想知道什么,我会使用Android上的第二课堂的语言失踪。在SL4A网站上它也被说成是阿尔法高质量的软件,这不完全是令人鼓舞的。

I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.

我也不太知道什么是脚本环境的限制是,如果他们是有问题的。

I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.

推荐答案

目前不能创建与Python使用SL4A可释放程序(或任何其他脚本语言)的时刻。我已经听到传言说这是一件谷歌正在开发,但即使他们这样做使它Python应用程序很可能是缓慢和耗电相比于Java。另外,脚本API只给你访问到本地Java API的一个有限的子集。我不会考虑使用SL4A严重的开发工作,目前,只为一次性的脚本和原型设计。

At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.

看看斯卡拉。它是在JVM上静态类型语言,但使用类型推断,除去大部分你在Java中获得的噪音。它也完全支持函数式编程,并有很多pythonish功能。因为它是静态类型是高效直的Java以无缺点。恕我直言,这是Java应该已经摆在首位的语言。

Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.

这是很多人都在博客如何使用Android上Scala的,因此谷歌围绕以获取更多信息。

A lot of people are blogging about using Scala on Android, so Google around for more information.