A template project for the latest Android Studio with an added Scala 3 module.
Helping the adoption of Scala in Android Studio.
This is the project you get if:
-
in Android Studio Android Studio Meerkat | 2024.3.1 Patch 1 you choose from menu:
New
>New Project…
>Empty Activity
(template for Phone and Tablet) -
you then add a minimal Scala 3.7.0-RC1 module named
core
and call it from theapp
module -
you use STTP to query ScalaDex and display the results. Credits and big thanks for this to @keynmol
Because is the first Scala version shipping scala/scala3#22632. The emitted Scala code is more compatible with Android ART.
Since currently all Scala libraries are not yet published to Maven Central with this version,
the workaround is to let Android R8 minify the code,
so minifyEnabled true
must be set even for debug
builds.
Android Studio is currently quite opinionated towards Kotlin,
so a Java module is not an option you get straight from the New
> New Project…
menu.
If you want the same project starting from the Java-only template, please check https://github.com/mcallisto/Scala-3-Android-Studio-Java-template.