Scala Programming for Android

Lemmy picture Lemmy · Jan 24, 2009 · Viewed 66k times · Source

I have followed the tutorial at Scala and Android with Scala 2.7.3 final. The resulting Android App works but even the most basic application takes several minutes (!) to compile and needs 900 kb compressed, which is a show stopper for mobile applications. Additionally, the IDE runs out of memory every now and then. I assume dex is not made for big libraries like the scala-library.

  • So my question is: Has anyone actually done this and is there any cure for this?

Answer

user75240 picture user75240 · Apr 20, 2009

I've written some basic Android applications in Scala, nothing too epic. Not being a Java programmer I was suggested to use a "treeshake", I was explained by a friend that this strips out all the unnecessary libraries from the jar files.

I have not documented it, but I found that someone else already has:

http://chneukirchen.org/blog/archive/2009/04/programming-for-android-with-scala.html

Proguard is not the only solution, you might find something that suits your work flow or is more suited for your environment.

Additionally google have just realised JACK , which deals with quite a lot of reducing build and memory times see https://source.android.com/source/jack.html