48

Has anyone had success developing a substantial Android app in Scala? Is it a viable option yet? Are there any mature development environments? Given the state of the Scala Eclipse plug-in, it looks as if there is no good IDE support at all other than possibly IntelliJ Ultimate.

A few people have posted tutorials describing how to fudge Eclipse ADT to sort-of support Scala, and how to to slim the Scala libraries using Proguard, but beyond that there has been worryingly little discussion about this topic.

Update 2011-08-01: An interesting article on Android+Scala from the developers behind the Bump app: Bump Dev Blog - How we use Scala in Bump for Android

Community
  • 1
  • 1
ehnmark
  • 2,656
  • 3
  • 24
  • 20
  • 1
    Also see https://groups.google.com/group/scala-debate/browse_thread/thread/125dd06446c8c078/461456b4244dc407?lnk=gst&q=android#461456b4244dc407 - looks like there are Dalvik issues even with proguard. Basically it's not so hard to produce code that runs into Dalvik's 5meg limit on class data, even after proguard. – James Moore Oct 18 '11 at 06:11

3 Answers3

39

I'm programming my Android application project in Scala.

If you are interested, you may take a look at this:

Ya, it is a Chinese website, but you may just take a look at screenshots to get some idea about that Scala can do everything with Android SDK just like Java.

The source code of these two android application is hosted on GitHub: http://github.com/brianhsu/Maidroid

Currently I don't use any IDE, because Vim / SBT is far more convenient and lightweight then any IDE I ever used.

And if you are using SBT to build your Scala Android application, you don't need worry about those progruard stuff, just install the sbt android-plugin and setup your project.

You may read this blog entry to learn how to build your Android application with SBT.

BTW, I use my own handcraft sbt plugin called sbt-android in my project, instead of android-plugin metioned in that blog post.

Brian Hsu
  • 8,781
  • 3
  • 47
  • 59
  • 4
    Hi Brian, and thanks for your answer and also for publishing the source code. SBT with any of those plugins looks like a nice approach. Have you had any issues with this approach whatsoever, or has it been a smooth ride all the way? Seeing that you've written Android apps in Java too, how would you compare the experiences? – ehnmark Jan 03 '10 at 11:25
  • 4
    whats the speed of scala based android applications ? Scala generates lot of class files and won't that slow down android app ? – Ajay Jan 17 '10 at 02:47
  • Brian, I'm getting a 404 when I try to find your sbt-android project on GitHub. Is it still available? I've been trying to get android-plugin to work with little luck - it seems to be pretty broken with the most recent versions of the Android SDK :-( Thanks! – Paul Butcher Jan 13 '11 at 11:31
  • @Paul Butcher Use an "at" so that @Brian Hsu gets informed. – Peter Schmitz May 11 '11 at 20:16
  • @PeterSchmitz The person who authored the question or answer being commented on is automatically (by default) copied on correspondence, and no "at" is required. – Jeff Axelrod Nov 18 '11 at 04:24
  • All links but zegoggl.es are dead (404) – om-nom-nom Jul 26 '12 at 14:40
7

There is a new plugin, AndroidProguardScala which makes everything simple :

https://stackoverflow.com/a/11084146/1287856

Tested on Windows 7, with Eclipse 3.7, scala 2.9 and without even using the command line or custom ant tools. With it, I have build a real application for my business that is currently published on Google play.

Community
  • 1
  • 1
Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101
1

I have a scala android tutorial it allows you to use the ant lifecycle targets provided by android. please see here http://saadstechblog.blogspot.com/2011/09/scandroid-scala-android-tutorial.html it also has a link to a github project with everything configured.

saad
  • 371
  • 3
  • 13