December 22, 2014

Android Beyond Java, Part One

toolsThis series of posts highlights a number of other languages and toolkits for developing Android applications, beyond the standard Java-based SDK. These are a preview of topics to be covered in CommonsWare’s upcoming book “Android Beyond Java”, to be released in 2010.

Alternative Application Environments

Here, I use the term “application environment” to mean something that can be used to create a full-fledged Android application. Many Java alternatives for Android are only suitable for creating extensions to an existing Android application, or scripts that get run by another program, or something. Those are useful, but if you want to build full Android applications, you need to pick something designed to support that.

With that in mind, here are some alternative application environments for Android, in no particular order:

  • PhoneGap: the granddaddy of them all. You create Android applications using HTML/CSS/Javascript, run in the WebView. PhoneGap injects Javascript objects into the WebView that expose many lower-level Android features, such as the accelerometer. And, done properly, you can create applications that run across multiple mobile operating systems, including iPhone and Blackberry.  PhoneGap is open source.
  • Appcelerator Titanium: follows the same philosophy as PhoneGap, using HTML/CSS/Javascript and WebView to provide a cross-platform environment. Appcelerator Titanium offers a bit more polish than does PhoneGap, but does not appear to support Blackberry at this time. Titanium Mobile is open source.
  • Rhodes: offers a Ruby and HTML approach to building applications. According to Rhomobile, they support iPhone, BlackBerry, Windows Mobile, and Symbian to go along with Android, and that the Ruby is apparently transcoded into something native for the platform. Rhodes is open source (GPLv3 with a commercial license option).
  • xmlvm: offers a Java->Objective-C cross-compiler. Coupled with a Android-esque Java wrapper to the Cocoa libraries, this gives you a means of taking code that runs on Android and moving it to iPhone. xmlvm is open source.
  • Scala: is a JVM language that some have tweaked to build Android applications, by blending the Scala and Android build chains. Scala is gaining popularity for offering functional programming in a JVM environment. Scala is open source.

In addition, it is possible that one will be able to create full applications using Flash in the near future, courtesy of Adobe and Google’s tie up via the Open Screen Project. Some people have already experimented with Flash applications on the HTC Hero. Also, the Cuttlefish Engine, due out late this year, will be a 2D/3D game engine that supports both Android and iPhone.

If you are aware of other frameworks, toolkits, or the like that support creating full Android applications without using Java, post them in the comments!

Next Post: Scripting Languages



  • harkje
    • http://intensedebate.com/people/commonsguy commonsguy

      You cannot build full Android applications, without using Java, using the NDK. I will be mentioning the NDK in a later segment of this blog post series, though.

      Thanks!

  • http://twitter.com/jimancona @jimancona

    Do the open source environments impose any licensing requirements on apps developed using them? Do I have to buy a commercial license to develop non-open source apps with any of these tools (perhaps because they use a copyleft license on a runtime library)?

  • http://intensedebate.com/people/commonsguy commonsguy

    Rhodes is GPLv3 with a commercial license option, as noted in the article. xmlvm is under the GPL, but it's not obvious which version. Those are the only two listed above that use copyleft licenses; the others are in the MIT/BSD/Apache line.

  • Dmitry Skiba

    I think that first thing beyond Java should be C++, but sadly you can't create full application with NDK.
    But we can change this.
    How about wrapping *all* Android classes into C++ "stubs" which will call Java methods? I've been thinking about it for a while. It is not that hard, we need to set up basic framework for passing java arrays, strings, interfaces, etc. After that we will write a (rather simple) generator which will create stubs for all SDK classes. Later we can even rewrite pieces in native C++.
    Sadly I don't have enough time to do it alone. But if someone else is interested we can just now.

    • http://intensedebate.com/people/commonsguy commonsguy

      I am not certain what you gain here. Crossing JNI boundaries for every API call will be expensive, to counterbalance gains from avoiding interpreted code elsewhere. I am not saying you should not try it; I am merely trying to temper your expectations.

      • Dmitry Skiba

        I've checked, calling "()V" Java method from native is as fast as calling it from Java itself. It slows with parameters though, down to a 2x (or was it 10x? I don't remember now) slowness on methods with 5 parameters (4 of them was Objects).
        This thing (for now I call it Cofra, "C ofr A[android]") will presumably come handy when writing native OpenGL games. Latest NDK allows to access OpenGL, but you should do everything else in Java, all input, dialogs, settings, etc. which pretty much defeats native OpenGL idea.
        Also I count on people that don't want to learn Java, or those that already have large pieces of C++ code that are troublesome to port (custom windowing library, for example).

  • Old Waba programmer

    FYI…Totalcross (formerly Superwaba) out of Brazil now supports the Android OS. Totalcross/Superwaba is a java-like virtual machine that is optimized to run on handheld platforms.

    In addition, applications written using for the Totalcross VM will run on Windows CE, MS Windows desktop, Linux desktop, iPhone, Symbian and the old Palm OS.

    Check it out here: http://www.superwaba.com.br

  • http://www.jfseostudio.com jf seo studio

    thanks for the list. It's good to have a lot of coding languages in your arsenal

  • Bob

    "In addition, it is possible that one will be able to create full applications using Flash in the near future"

    Not any more…
    http://news.bbc.co.uk/1/hi/8639240.stm

  • http://chairila06.student.ipb.ac.id chai

    nice info…

    maybe i can try make some simple aplication for mobile with java…

  • http://www.bsiproductdevelopment.com/ product and design

    Since, I am interested and also a user, would like to learn about this series of posts highlights a number of other languages and toolkits for developing Android applications, beyond the standard Java-based SDK.

  • Pingback: IDC: Android and iPhone in Dead Heat to Win Enterprise

  • Pingback: IDC: Android and iPhone in Dead Heat to Win Enterprise « Mr. Android

  • Pingback: IDC: Android and iPhone in Dead Heat to Win Enterprise | Android Tablet Best - Provide best valued Android tablets with ROMs, software, Q&A, howtos, and latest news

  • Pingback: туроператор по израилю