You are here: SE » ThesesHome » ThesisScalaOnAndroid

Scala on Android: problems and solutions

Android applications are usually developed with the Java programming language and the Android Software Development Kit (Android SDK). The program code is compiled to Java bytecode and then translated to so-called Dalvik bytecode, an Android-specific bytecode format, which is executed by the Android Runtime (ART). Although this is the only officially supported and documented way of creating SDK apps, Android’s compatibility with Java bytecode opens the door to a variety of other Java Virtual Machine (JVM) technologies. In fact every JVM programming language that interops with the Java Android SDK might be used as a fully functional alternative to Java.

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 useful tools, such as: type inference, functional programing paradigms, actor-based concurrency and multiple inheritance with traits (as an improvement to Java interfaces) to just mention a few of them. Scala’s steadily growing community has recently started a couple of ambitious projects aiming to make Scala on Android a comfortable experience.

Problem

Google provides a comprehensive set of tutorials, documentations and especially development tools that make it incredibly easy to have a quick and painless start as a developer on the Android platform. To get started with Scala on Android however, one needs not only to switch the language but also exchange development tools and the build system entirely. To be more specific, using Scala on Android means to sacrifice the Android Studio IDE, the Gradle build system, code liniting and plenty of other comfort features. So, for people who value Scala high enough to make this compromise there still remains the major obstacle of getting the first setup and configuration right before the actual work can happen. This is an error-prone process and, in conjunction with the concise documentation of the Scala on Android community tooling, frustration is inevitable.

Furthermore the Scala (on Android) toolchain evolves rather quickly which makes it difficult to stay on top of the things if you’re not actively following along the development internals.

Goal

To make using Scala on Android as easy as possible, it is necessary to identify common problems and according solutions. These need to be composed to a comprehensive documentation that lowers the first steps barrier to a minimum and guides the user through the entire process of setting up the environment. To prevent the documentation from getting outdated by the quickly evolving toolchain it has to be easily maintainable and also needs to be available for public collaboration.

Approach

Interviewing developers that already made experiences with Scala on Android development should help identifying emphasises for the documentation.

The documentation needs to be published as a website to reach a broad audience, also making it easy to find and access. It has to be a static page in order to guarantee easy deployments and local executions. Its source files should be available on GitHub to encourage the developer community to collaborate if changes or updates become necessary.

Additionally, the thesis describes the process of preparing, conducting and evaluating the interviews and the procedure of creating a suitable documentation for the findings from the evaluated data. Once the documentation is available, another round of interviews and feedback collection is necessary to examine its effectiveness.

On top of that, it would be desirable to analyze the actual advantage of Scala language features over Java (focussed on Android design patterns). These need to be verified by additional expert opinions.

Comments