3 ms·
I needed to write a very simple Android app a few months ago and decided to use Scala. This was my first and only experience with Android development, so that m
by RussianCow 10y ago
I needed to write a very simple Android app a few months ago and decided to use Scala. This was my first and only experience with Android development, so that may have had something to do with it, but I wouldn't recommend using Scala for any serious project. It took me a ridiculous amount of time to get a functional dev environment, and I probably spent the first week fighting with the tools. I finally got IntelliJ IDEA set up to where I was mostly happy with it, but I never managed to reach that final 10% of functionality—for instance, I never got the IDE to auto-compile on save, which meant I had to keep an SBT session open and couldn't reliably use the IDE GUI for running the app. (Sometimes the two would compile at the same time and I'd get all sorts of weird errors that could only be fixed with a clean.)
Having said all of that, once I got everything working, I felt that using Scala was worth the pain. Programmatic layouts using scaloid gave me a vastly better experience than coding them in XML, and implicits worked really well for passing around the Context object. The tooling just wasn't, by any means, reliable, so I wouldn't recommend it for any apps your career depends on. :)
I haven't tried it, but I've heard that Kotlin is a nice compromise if you're looking for a language nicer than Java with more reliable tooling than Scala.
- the_af 10y agoThanks for the feedback! It's unclear to me whether your pains were specific to Scala on Android or with Scala tooling in general. I'm already familiar with server-side Scala development using IDEA and I'm relatively comfortable with it, so that's not a problem. Is IDEA awful for Android development?
- RussianCow 10y agoTo be totally honest, I'm not sure either, as I had only minimal experience with Scala prior to that, so I don't know how much my anecdote is worth. :) I found IDEA fine for Android development, but I also didn't even try Android Studio, so I don't have anything to compare it to. That said, the little server-side Scala work I've done seemed to be a little more seamless than Scala with Android. It's been a while, so I don't remember the details, but I'm pretty sure little things like compile-on-save worked just fine in IDEA for normal Scala development, but didn't work at all (for me at least) with Android. You're also likely going to run into problems replacing Gradle with SBT (assuming that's the path you take), since Gradle is the official build tool and has all the mindshare; if you run into an Android-specific problem with SBT, you're most likely on your own, given that so few Android devs use Scala. IIRC, I had a few issues getting multidex to work because the Scala-on-Android guide I was following was out of date. I would say that if you're already familiar with Scala and aren't afraid of getting into the weeds a little bit, you should be fine in the short-term. My personal fear is simply that, especially with Scala 2.12 dropping support for Java 6, Scala development on Android doesn't have a clear future, so as Google changes their build stack, you may find it increasingly harder over time to keep all the tools working.
- simono 10y agoI don't think the Scala-on-Android devs have any plans of giving up, they just took a wait-and-see approach until Google ships their new Jack/Jill stack: http://get-scala.org/2.12#scala-on-android http://get-scala.org/2.12#scala-on-android There is no sense of hurry as 2.11 won't go away and will have a long life.