Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art

Introduction: Other Programming Languages

Published? true
FormatLanguage: WikiFormat

Problem:

N/A

Discussion:

Developing new programming languages is a constant process in this industry. Several new (or not-so-new) languages have become popular recently: Erlang, Scala, Clojure, Groovy, C#, F#, and more. While the Apple approach on the iPhone has been to mandate use of Objective C and to ban (at least officially, it seems to be honored more in the breach) use of other languages, particularly JVM-style translated languages, Android positively encourages use of many languages. You can write your app in pure Java using the SDK, of course - that's the subject of most of the rest of the book. You can mix in some C/C++ code into Java using native code, using Android's NDK. People have made most of the major compiled languages work, especially (but not exclusively) the JVM-based ones. You can write using a variety of scripting languages like Perl, Python, Ruby, see Getting Started with Scripting Layer for Android. And there's more...

If you want a very high-level, drag-and-drop development process, look at Android Application Inventor, Google's own toolkit for building applications easily. At present these can't easily be packaged as apps, but this will probably come fairly soon.

If you are a web developer used to working your magic in JavaScript and CSS, there is a route for you to become an Android Developer using the tools you already know. There are, in fact, five or six technologies that go this route, such as AppCelerator Titanium, (list others here...). These mostly use CSS to build a style, JavaScript to provide actions, and W3 standards to provide device access such as GPS. Most of these work by packaging up a JavaScript interpreter alone with your HTML and CSS into an APK file. Many of these have the further advantage that they can be packaged to run on iPhone, Blackberry, and other mobile platforms. The risk I see with these is that, since they're not using native toolkit items, they may easily provide strange-looking user interfaces that don't conform either to the [GUI Guidelines] or to users' expectations of how apps should behave on the Android platform. That is certainly something to be aware of if you are using one of these toolkits.

Whether to use the standard SDK or to go the HTML/CSS route is a continuing debate. To view the pros and cons on both side, check out this DEVOXX presentation.

One of the key ideas in Android was to keep it as an open platform. The wide range of languages that you can use to develop Android apps testifies that this openness has been maintained.