Scala on Android

The comprehensive documentation

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

Prerequisites

Developing with the Scala on Android toolchain is a considerably resource intensive undertaking. Depending on your editor and whether you keep emulators running during development or not, the memory consumption does vary greatly. You should be equipped with at least 4GB of RAM to cover the common use cases that are demonstrated in this documentation. Since compiling Scala code is known to be a tedious process, a fast CPU might improve this for you.

  • Information reliability Moderate Might become outdated
  • Last edit Fri Jul 10 19:44:32 2015 +0200
  • Edit on GitHub

Java Development Kit (JDK)

Android supports Java 7, so the JDK 7 should also be your choice for now. If you already have a newer version of the JDK installed, this will work as well, but then you have to specify your compile target properly to version 1.7, which will be explained in the build tools topic.

  • Information reliability Moderate Might become outdated
  • Last edit Fri Jul 10 19:44:32 2015 +0200
  • Edit on GitHub

Android Software Development Kit (Android SDK)

The Android SDK is a comprehensive tooling suite. It comes with applications that compile Java to Android bytecode, debugging and profiling applications, the Android emulator and a whole lot more.

Download and install the SDK. Then open your terminal and run android sdk. The Android SDK Manager window will pop up and ask you to install Android version specific documentation, development APIs, sources and disk images for emulation. For a quick start it is sufficient to stick with the default selection.

A screenshot of the Android SDK manager with recommended settings
  • Information reliability Fragile Might become outdated very soon
  • Last edit Fri Jul 10 19:44:32 2015 +0200
  • Edit on GitHub

Build Tool

Build tool integration plugins for Scala on Android are currently available for sbt, Gradle and Maven. The Scala Build Tool (sbt), is the Scala standard build tool and its configuration files are also written in Scala. The Android SDK Plugin for SBT is a very mature and well maintained plugin, furthermore most Scala IDEs integrate Scala nicely. Therefore sbt is the build tool of choice for this documentation.

A comparison of available build tools and detailed instructions for sbt is waiting for you in the next chapter.

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

Editor / IDE

You are more or less free to use any editor of your choice. With IDEs the integration process might cause a little trouble and depends on your build tool of choice. Please refer to the Editors and IDEs chapter for further information. The recommended tool is IntelliJ IDEA, which is also used as reference throughout the documentation.

Further reading

Comments