One year ago, I was excited how easy scala development could be done for Android within Eclipse. I just added the scala-ide plugin for eclipse plus the ANDROID_PROGUARD_SCALA plugin. Everything worked nicely out of the box.
When you search the web today this procedure is still promoted actively in many places such as the official SCALA
website. Just try this if you have a few hours to loose. I tried it with the SCALA ide and Eclipse Luna standard edition ....
The next thing I tried was the new SCALA activator tool which looks great and you can find templates for Android and Scaloid. Unfortunately, they seem to be outdated and you should try to use activator for this purpose, only if you have a few hours to loose....
After too many hours lost, this is how it worked out for me:
- Start from the hello scaloid project template.
- Update the plugins inside /project/plugins.sbt to their last versions.
- Set ANDROID_HOME to the path where you have stored your Android SDK.
- Start sbt inside the project folder.
- You can call "sbt android:package" to compile the project.
Unfortunately the Proguard settings are not good anymore. I have to look into Proguard settings at a later time. For now, I set useProguard := false in build.sbt to get started.
- "sbt run" puts the apk file on your connected device and runs it. Now you can compile and run the Android command line tools.
- Do you want to compile, run and debug from an IDEA? "sbt eclipse" creates you a project. Unfortunately again, this does not work! No easy eclipse integration.
IntelliJ IDEA comes to a rescue.
- Add the sbt-idea plugin to sbt.
- Run "sbt gen-idea"
- Now you can open your project with IntelliJ and compiling and debugging works fine through the IDEA.
As a conclusion, it is pretty clear that the pragmatic Android developer is not going to write his code in SCALA.