Android without Java

随声附和 提交于 2019-12-02 16:39:55
dbyrne

Personally, I'd say Scala is your best bet right now. It works really well, with the one drawback being that you are required to include Scala as a dependency (which will increase the size of your application).

apg

Have you looked at Mirah? It gives you a Ruby-like syntax and compiles to Java. It’s been labeled the CoffeeScript of Java.

Is there some possibility I'm missing?

Tons of 'em!

Clojure seems to run in exactly the problems I've illustrated above with Dalvik

I'm not aware of this. Any JVM language that is an ahead-of-time compiler (i.e., generates Java bytecode on the developer PC) should work with Dalvik.

but as the AppInventor is built on Kawa there might be hope for a Lisp on the mobile platform

AFAIK, App Inventor is only using Kawa for code generation.

What other languages are already usable or make strides towards that?

Well, there's HTML5 (Javascript), which works OK in offline mode.

Or, there's PhoneGap (HTML+CSS+Javascript).

Or, there's Rhodes (Rails-esque apps in Ruby on the device).

Or, there's Titanium Appcelerator Mobile (HTML+Javascript, but with Javascript hooks to render native UI widgets).

Or, there's Flash, at least for Android 2.2+.

Or, there's AIR...well, OK, that's still in pre-release.

As Elfred noted while I was writing this, there is JRuby with Ruboto.

There are Bedrock, Corona, DroidScript, Flixel, MobiForms, MonoDroid, MoSync, Squeak, and SuperWaba.

There's C/C++ through the NDK, though that's mostly for adding extension libraries to a Java app more so than writing full-on native-code apps.

There's SL4A (formerly the Android Scripting Environment, or ASE), which is your gateway to Python, Perl, Lua, and other scripting languages. As of this moment, you cannot package these scripts up as APKs, but they're working on that.

Now, none of these are going to give you precisely the look of a "regular" Android app. For those, you need a JVM language with ahead-of-time compilation. And there is no question that bog-standard Java Android apps are far and away the most numerous. But unlike some fruit-flavored operating systems that block this sort of thing, you have lots of places to experiment with alternatives to traditional Java coding with Android.

Some balding guy is writing a book that is going to review all of these options, but that's only partially ready right now.

This link has some details on how to get scala apps working on android. I'm sure you can do something similar for clojure or other jvm languages.

Ruboto is aiming to bring JRuby in.

DroidScript is probably one of the easiest of the above mentioned development tools to use for Android development. Like Cordova you use JavaScript, but unlike Cordova you have the choice of using native Android GUI's or HTML5 to build your App interfaces.

Also you still have access to all the devices sensors/hardware without needing to import loads of complicated plugins. Plus you get the bonus of being able to develop actually on your mobile device if you need to (you can even build APK's and publish them from your device).

I would say its very good for beginners or prototyping but perhaps not flexible enough for seasoned developers.

Xamarin Studio let's you build in C#/Mono and build apps for both Android and iOS. Now the presentation layers have to be implemented differently on both platforms, but for the ability to use C#, it's a big Win.

You can build an android app with the knowledge of just Html/css/Js. So there is no need of Java to create an android applications. Visit here for some basic knowledge. [1]http://www.chromeearth.com/requirements-cordova-platform/

I have never used it, but Kotlin is a new language that runs on the JVM developed by JetBrains (the maker of Android Studio) that deserves a mention. The Kotlin website claims the language is 100% interoperable with Java and has a tutorial for Getting started with Android and Kotlin and Android Studio now actually comes with Kotlin support.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!