views:

1034

answers:

11

Hey all,

I've started developing Android apps a couple of months ago, and have a few under my belt. While I can tolerate Java enough to keep developing, I was wondering what success the community has had getting other languages to run.

I've done some investigation as to how other JVM languages work, and it appears Dalvik messes them up pretty hard. Clojure seems unable to run, Scala seems to be one of the most successful. JRuby has also had some luck, but they caution against anything major. I've also checked out Scheme via Moby and Kawa, both of which seem to have some promise.

  • What luck have any of you had? Languages I'm missing, misrepresenting?
  • Any non-"Hello World" apps you've written in non-Java?
  • Any snags in trying to get another language to run (e.g. "as long as you don't use continuations, you're fine in X Scheme").
  • Any particular snags in developing apps non-Java, once you get them to run?

Thanks, hope you well ^_^

+7  A: 

Have you checked out the Android NDK?

It allows you to develop high-performance Android Apps using Native code (Gets you C and C++ which is, decidedly, not Java).

Justin Niessner
+1 for the NDK as an alternative, but as a note it is not really economical to develop a full standard application using only the NDK.
Quintin Robinson
Isn't the WePad supporting Android applications on an Atom CPU? Native Arm code wouldn't help much.
stesch
A: 

There is also rhodes: http://github.com/rhomobile/rhodes and I hear that jruby does work now on Android.

nkassis
+1  A: 

Miguel de Icaza announced the other week that Mono (C#) is being ported to Android (MonoDroid), as has been done before on the iPhone (MonoTouch). Not available yet, but hopefully later on this year.

tomlog
+3  A: 

You can write apps in C and C++ using the android NDK.

You can also use the SIMPLE language, which is supposed to be similar to BASIC.

You can use the Android Scripting Environment to write apps in scripting languages like Python, Lua, etc...

Adobe is supposed to be working on an Android version of Adobe Air as part of their work to get Flash working on Android devices.

As for other JVM based languages I think you've hit on the main ones, with Scala being the most successful one from what I've read. I think once Dalvik fully supports the JIT complier that JVM scripting languages like Groovy will get much closer to working on Android.

mbaird
FYI The JIT for Dalvik on Android is extremely unstable and not yet released/enabled for production phones.
Quintin Robinson
The problem with languages like Groovy isn't so much Dalvik JIT but their own JIT. Languages that create Java VM bytecodes from their interpreted structures need to be modified to generate Dalvik VM bytecodes instead, which probably isn't trivial. That's one of the reasons that my example Android scripting language is Beanshell, because it's as dumb as a box of rocks in terms of such optimizations, so it runs on Dalvik without modifications (other than a recompile onto a modern browser).
CommonsWare
A: 

Have you tired Simple its something like BASIC for android..you will find it at googlecode.

Fred Grott
+1  A: 

There are so many options, I'm writing a book about 'em!

Here is a series of blog posts I did on the then-current roster, back in October.

CommonsWare
A: 

Why not use webkit? Granted there will always be a need for native apps, but maybe some of those apps under your belt would have been just as good being browser-based.

Before you think about the limitations of webkit, check out this article.

Erik B
A: 

I don't understand the issue that people have with Java, or any other language really. The language is just a tool that lets you accomplish a task and imho by trying to shoehorn in other languages you are creating more trouble for yourself than you would have if you just learned the language. This argument hold true for Obj-C for iPhone as well.

CaseyB
-1 for ranting and not answering the question
Janusz
The issue is presumably they'd prefer a different language. The reason I'm reading this thread is because I too do not wish to use Java if I can avoid it. Why? Because I spent many years working with Java and being fed up with the straightjacket I had to wear compared to working in C++. Years later, languages like Ruby and Scale are around, makes for an interesting if different choice rather than just looking for C++ support. Personal preference is all it is about. If you love using Java that is just fine.
Stephen Kellett
It's not that I love using Java, I just see Java as a tool to get the job done. If the SDK is tuned to work with Java then it seems that's the straightest line to a solution. Writing in Java, or C++ with the NDK most likely makes the most efficient code and is the most well integrated with the devices. It's also the most up to date solution being that it doesn't need to be ported after each SDK release.
CaseyB
+1  A: 

Something completely different is Titanium mobile. This enables you to write your app as a webapp with as they state HTML, CSS, JavaScript, Python and Ruby. The titanium framework then generates a mostly native behaving application for the iphone or android devices.

If somebody has used this framework please leave a comment. I only heard about it and are very interested in every first hand experience.

Janusz
A: 

The JRuby guys also have a side-project language called Duby, a Ruby-like language that compiles directly to Java bytecode, with no significant performance hit compared to normal Java. I ran into some Android example code on Github last night and it is pretty clean looking, so you might want to look into that.

Yanik Magnan
A: 

You can write your Android apps with Ruby with Rhodes (http://rhomobile.com/products/rhodes).

Adam Blum