"Hello, Android!" by Scala
Install Dev Tools
Install scala, sbt, android-sdk by homebrew:
$ brew install scala sbt android-sdk
Set $ANDROID_HOME and $PATH:
export ANDROID_HOME=/usr/local/Cellar/android-sdk/r16 export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
Install SDK:
$ android
Create AVD: Tools -> Manage AVDs:
Install android-plugin:
$ git clone git://github.com/jberkel/android-plugin.git $ cd android-plugin $ sbt publish-local
Install giter8:
$ curl https://raw.github.com/n8han/conscript/master/setup.sh | sh $ ~/bin/cs n8han/giter8
Hello, World App
Create template:
$ g8 jberkel/android-app Template for Android apps in Scala package [my.android.project]: org.kentarok.myapp name [My Android Project]: MyApp main_activity [MainActivity]: scala_version [2.9.1]: 2.9.1 api_level [10]: 15 useProguard [true]: true Applied jberkel/android-app.g8 in myapp
Launch sbt:
$ cd myapp $ sbt > android:package-debug > android:emulator-start <my_avd> # Your own AVD name > android:install-emulator