Skip to main content

Android without Java



After doing the whole "enterprise" programming for a while, I'm seriously disillusioned by the language itself and always feel quite hampered if I have to go back to it. The project size of your average Android app isn't too intimidating and the libraries are actually quite nice regarding their coding style, but if I could avoid Java, I'd certainly do.





So that's the question: Can I avoid it? While there are lots of JVM language that would be an option on desktops and servers, the Dalvik VM and the devices themselves pose some limits. This seems to be a bit better in 2.2 with the JIT, but limiting myself to the cutting edge would be a rather harsh decision.





The only alternative I know that's used somewhat seems to be Scala. Is there some possibility I'm missing? Clojure seems to run in exactly the problems I've illustrated above with Dalvik, but as the AppInventor is built on Kawa there might be hope for a Lisp on the mobile platform?





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


Comments

  1. 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).


    Scala Programming for Android
    Can I program for Android using any JVM language?
    Getting Started Programming in Dynamic Languages in Android

    ReplyDelete
  2. Have you look at Mirah? It gives you a ruby like syntax and compiles to Java. It's been labeled the CoffeeScript of Java.

    ReplyDelete
  3. 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.

    ReplyDelete
  4. 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.

    ReplyDelete
  5. MoSync use c/c++ or Javascript or a combination of both. Create Hybrid or Native apps. Henrik

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex