Is it possible/practical to program android in a language other than Java?
So when I read that it really got me thinking about how great it would be if I could program android apps without using Java. This is relevant to me because I know plenty of programming languages but I really haven't picked up Java or its predecessor C++ (technically I did make a basic android app essentially using what little I have learned of C).
Anyway its been a few months since I read that story and I have been digging around here and there (not too seriously) and have come across a few posts/blogs/ect affirming that it is possible and there is a tiny bit of documentation out there (for instance I found some python users out there using "Jythonroid")
Anyway the question is, is it really practical to program android in another language (yes I realize android utilizes XML in addition to Java) and if so which is the language(s) of choice?
Additionally, any bread crumbs that can be left leading to documentation would be very much appreciated.
Thank you.
Student
Daytona Beach, FL
8 comments
[ 2.6 ms ] story [ 24.7 ms ] threadhttp://android-developers.blogspot.com/2011/01/gingerbread-n...
Edit: Here's where it was -
http://stackoverflow.com/questions/476111/scala-programming-...
And some more information:
http://riddell.us/ClojureAndAndroidWithEmacsOnUbuntu.html
http://stackoverflow.com/questions/3242034/android-without-j...
http://stackoverflow.com/questions/2832773/alternatives-to-j...
http://stackoverflow.com/questions/3002566/can-i-program-for...
http://stackoverflow.com/questions/1994380/substantial-andro...
If you Google "Dalvik VM" you'll find lots of interesting information, too many to list here. There's a Google presentation which is very good.
So the answer to your question, is that so far, AFAIK, there is no compiler that directly generates Dalvik executables into .dex files. Currently, you need a Java .class file or a .java file and get it translated into a .dex file. But a retargetable compiler, like llc, could be customised to generate .dex files directly. An interesting project.
The one that's been around longest but the most limited is the ASE (Android Scripting Environment) http://google-opensource.blogspot.com/2009/06/introducing-an...
Using the ASE you can create some simple programs to do small tasks.
If you're looking to build a full app you're probably going to be looking at either working through Java, or if you're on Gingerbread you can use C++. Previous versions of Android allowed for C++ libraries being linked to your apps but had no way to access the APIs for creating graphical interfaces. That's now changed so I recommend you look into the SDK and NDK if you're really serious about building on Android. http://developer.android.com/sdk/ http://developer.android.com/sdk/ndk/
The only other option that I know about is that the Mono framework is being ported to android (.NET framework port). So if you know C# or any other .NET language you may be able to start there, although I think it's currently in closed beta. http://monodroid.net/
However, as an Actionscript guy I am curious about using AIR to write Android apps. Specifically, if I did this, would I be able to offer upgrades to native apps writen in Java down the road? Or would the Java versions have to be installed as separate apps rather than upgrades?