I'm not an android developer nor a java expert but I've been searching a lot for developing android apps using Scala lately. I found some things like Scala on Android and also a lot of questions and answers here as well but most of them are outdated (they're mostly between 2013 to 2017). Also, Scala on Android's last release was in 2017. So, I guess there wasn't a really big improvement there.
I read somewhere that the main issue is lambda expressions in java but that make no sense. What is the real reason that holds developers from using Scala in android?
I know that Kotlin is the preferred way to develop android but is there any way to develop the whole app in Scala? Is it even possible? if it is, is it a good idea?
What about Scala 3? Is there any hope that the new version of Scala have a future for android development?
The broad reason is that the maintainers of the official Scala compiler made a decision to only emit bytecode targeting Java virtual machine versions for which Google did not (at the time) support compiling into Dalvik. (The Oracle v. Google legal proceedings may have influenced Google's decision).
In the interim, Google has added support for some Java 8 features. However, the support is not complete, and Scala uses some features which Google's tooling doesn't support.
This scala-lang.org discussion covers some of the major hoops which had to be jumped through to build an Android app in 2.13; it included patching the Scala standard library in order to make the collections work. It does look like there's a chance Scala 2.13.7 will be patched to address at least some of the issues.
In the meantime, the historical Scala on Android project had largely been abandoned; there is apparently the beginnings of an effort to begin a new project based on Scala 2.13 and Scala 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With