This is a template project that can be a starting point of a new Scaloid project.
This contains minimum code as possible; therefore easy to run, examine and extend.
- sbt 0.13.5 or above
- Android build tools 20.0.0 or above
- Android SDK
- Both SDK Level 10 and the most recent version should be installed.
You can build this project using sbt:
$ sbt android:package
This will compile the project and generate an APK.
For more command, refer to android-sdk-plugin for sbt.
In sbt, ~
is a prefix that repeatedly runs the command when the source code is modified.
~run
This sbt command schedules to execute compile-package-deploy-run process after you save the edited source code. Compiling and packaging runs incrementally, so this iteration takes about only few seconds.
If you use default AVD, try genymotion or other faster virtual device. Deploying apk to the device becomes much faster!
We recommend to use IntelliJ, not Android Studio nor Eclipse.
$ android update project -p . # in the root of the project
Make sure the Scala & SBT plugins are installed in IntelliJ IDEA
File -> Import Project... -> select project root folder -> OK -> Import project from external model -> SBT Project -> Check "Use auto-import" & for Project SDK, select an Android API platform -> Finish. Choose to configure the android project when IDEA asks.
Edit the generated run configuration. Remove the 'Before launch: Make' then add a new SBT command android:package-debug
then tab out or it
will not save, then click OK then OK.
You now should be able to run and debug from the run configuration like normal.
Local path doesn't exist.
when Intellij tries to deploy the apk.
File -> Project Structure -> Modules -> hello-scaloid-sbt -> Android -> Packaging -> Then choose the APK Path for the apk. For this project it should be in .../bin/hello-scaloid-sbt-debug.apk
The most likely cause of this error is that your SDK build-tools are old. Update the Android SDK and retry.