Starting with Android: Java or Python (SL4A)

后端 未结 5 2010
借酒劲吻你
借酒劲吻你 2021-02-01 09:38

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 usi

5条回答
  •  清歌不尽
    2021-02-01 09:56

    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.

    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.

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

提交回复
热议问题