Scala on Android

The comprehensive documentation

  • Information reliability Sustainable Won't become outdated
  • Last edit Fri Jul 10 19:44:32 2015 +0200
  • Edit on GitHub

Introduction

Android applications are usually developed with the Java programming language and the Android Software Development Kit (Android SDK). The program code you write gets compiled to Java bytecode and is then translated to so-called Dalvik bytecode (an Android-specific format). On the actual device the Android Runtime (ART) is then able to execute these instructions. For you, as an application developer, this process is entirely happening behind scenes and does not affect you. It does, however, leave you the freedom to decide how to generate your bytecode.

Although Java is the only officially supported and documented language to create SDK apps, Android’s implicit compatibility with Java bytecode opens the door to a variety of other Java Virtual Machine (JVM) technologies. In fact, every JVM programming language that is able to interop with Java APIs might be used as a fully functional alternative to Java.

Waving android with the Scala logo on its chest

The Scala programming language is one out of several JVM technologies that fulfills this requirement. On top of that it covers most features of Java and adds a variety of highly useful capabilities, such as: type inference, functional programing paradigms, implicits and traits (as an improvement to Java interfaces) to just mention a few of them. Scala’s steadily growing community has recently created a couple of ambitious projects aiming to make Scala on Android a compelling experience.

  • Information reliability Sustainable Won't become outdated
  • Last edit Wed May 13 19:24:18 2015 +0200
  • Edit on GitHub

Target audience

This documentation teaches you how to properly use and configure Scala on Android. It neither teaches you Scala nor Android development.

  • Information reliability Moderate Might become outdated
  • Last edit Wed May 13 19:24:18 2015 +0200
  • Edit on GitHub

You are not safe here

Leaving the safe haven of Google's Java environment does not come without a price. To enjoy the benefits of Scala on Android you have to not only sacrifice official tooling support and deal with longer compile times but you also have a much tougher build configuration ahead of you to get basic things working. If you still think that Scala is worth the hassle, this documentation is there to guide you past the rough edges.

Further reading

Comments