Scala with Android - does anyone have any experience?


Au? Does anyone have any experience with Scala in Android?

I like the syntax a lot, but in fact it's still the same inside, like Java - so it's probably suitable for Android

Author: Barmaley, 2012-01-23

6 answers

Here are a couple of plugins for building Scala apps for Android:

 6
Author: stanislav, 2012-01-23 12:23:39

I have experience. The main problem is that android has its own archive format (instead of jar -- dex). In the format, there is a limit of 65,535 methods/per file, and scala abuts this limit. This can be dealt with using tools such as proguard, which cuts out all the unused code, and makes a number of optimizations, but it does not work fast and each and so not fast cycle "built an application/poured on the phone-emulator/tested" is even more delayed.

Earlier (before version 2.2, when it seems that JIT was done in android) the code written in scala was slower than plain java, now this difference is not noticeable. There is a noticeable difference in memory consumption (but difficult places can be written in an imperative style - scala allows it, or written in java - as mentioned here, you can mix any jvm languages that are compiled into class files in one project, such as Java, Scala, Clojure, Kotlin and other less popular ones).

Otherwise, the development is quite simple. nice (for example, the plugin that @murmurmur mentioned allows you to use typed resources, and not to cast each resource that you select by id).

 10
Author: om-nom-nom, 2012-09-07 14:14:53

They write in our team. I'm really not a mobile developer myself, I do backend work, but you can read the reviews of the developers themselves here. They write in Android Studio as far as I know. From the user's point of view, there were no special problems with the mobile app.

 2
Author: Aleksander Alekseev, 2015-04-08 20:55:50

It should work. In principle, you can take any language that generates class files for java 1.5 - 1.6. And the Android compiler simply distills them into dex files and packs them into the apk archive. Moreover, you can combine different languages in different proportions in one project.

 1
Author: KoVadim, 2012-01-23 11:03:09

This has already been discussed here: Adding Scala support in a few clicks ...

Maybe it will help :)

 1
Author: Alegorius, 2012-01-23 12:25:25

I can offer to look at this article " Hello, World!" on Scala for Android

 0
Author: Igor Fedorov, 2016-03-17 20:58:58