Scala Programming for Android

前端 未结 9 1371
无人及你
无人及你 2020-11-29 14:14

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

相关标签:
9条回答
  • 2020-11-29 14:53

    For tutorials and examples, see also Stéphane Micheloud's "Exploring Android" page: http://lamp.epfl.ch/~michelou/android/

    0 讨论(0)
  • 2020-11-29 14:55

    You can use the Scala on Android without SBT, it built externally by Gradle to create Android applications. https://github.com/yareally/android-scala-intellij-no-sbt-plugin

    Gradle is more native building tool for android than SBT.

    There is good example of Scala client and server side solution concept, and gradle building tool as advance for IntelliJ IDEA workbench.

    Big advance that core classes are common for client and server.

    https://github.com/ghik/akkdroid

    Good tutorial for IDEA and android-plugin: http://fxthomas.github.io/android-plugin/

    0 讨论(0)
  • 2020-11-29 15:01

    If you use maven, use android-scala-test as a startup template. It works great for me out-of-the-box.

    Scaloid is an Android API wrapper written in Scala that help you to write your Android program in Scala-style.

    0 讨论(0)
  • 2020-11-29 15:05

    Developing Android apps for Scala is continuously evolving. The current best way to do it appears to SBT in conjunction with the android-sdk-plugin, which is maintained* and works well for me in my Scala/Android project. A somewhat recent example that demonstrates the use of this plugin with the already mentioned Scaloid can also be found.

    Please note that this question is a typical example of a question with outdated answers on Stack Overflow. This answer will likely become outdated at some point as well.

    * The other SBT based projects mentioned in this answer thread don't appear to have code being written for them in the last six months at the time of writing. They may have compatibility issues with newer versions of Scala and SBT.

    0 讨论(0)
  • 2020-11-29 15:08

    The biggest issue with Scala on Android is the compile times.

    Possibly because of the Proguard class stripping compiles with IDEA13/Scala plugin on a Dual Quad Core (8-CPU) E5450 Xeon with 8GB can take two minutes or more.

    I simply moved back to Java after completing a largish Scala Android project as compile times were too frustrating.

    0 讨论(0)
  • 2020-11-29 15:09

    I verified this detailed solution with Eclipse 3.7, Scala 2.10 and the plug-in AndroidProguardScala v50:

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

    Everything works fine. A simple test application with scalafied main activity class only takes 38Kb. Libraries projects are supported. Proguard is activated when exporting the project.

    0 讨论(0)
提交回复
热议问题