开发者

Can I program for android using any JVM language?

Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to pr开发者_JAVA百科ogram for android, or is it java only?

There was a similar question asked over a year ago but I wasn't sure if there'd been any change since then.


Check out these links:

  • Scala 2.8 on Android
  • Android examples in Scala
  • Clojure on Android
  • Ruboto - An IRB application for JRuby on Android
  • Android Scripting (Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl)

However, I am unaware of any prominent applications that have been coded in any of these languages. The examples I've seen fall more into the "proof of concept" category. While the cool factor is high, I still don't see these languages as a viable tool for serious Android developers. I'd love to see someone prove me wrong though!

It seems like Scala is the closest to getting there right now.


I'm not sure how other JVM language performs, but I really think Scala is the one that could use for a serious Android project.

Of course it has some problem (like Google Maps Android API is not usable without some workaround), but it works very well with the default Android SDK.

I personally use Scala to develop my Android application (Maidroid Reminder) which is already been download about 5000 times according to the statistic of Android Market.

It's not a "prominent" application of course, but it uses lots of feature of Android SDK, like ContentProvider/Broadcast Receiver/MediaPlayer.... etc, and it works very well and I felt much more fun than coding in Java.

And the best thing of using Scala to develop Android application is that the user don't need install any runtime like Android Scripting Environment needs!

Just release your APK file, and the user could install your application using Android Market or ADB.

If anyone is interested in how an Android application written in Scala looks like, you may browse the source code at GitHub.


From a little searching it looks like there already exists a JRuby scripting environment for the Android platform.


Currently most dynamic languages perform poorly on the Android Dalvic JVM. They will run but with more CPU and memory useage than you probably want. I hear they are working on improving that though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜