The repo to drive the Scala Meetup on Android.
To make this work you need to ...
- install git, sbt (using macports or brew) and the Android SDK
- you can then clone this repo and checkout the various tags/steps to walk through the tutorial
- create an empty directory and in this directory create a directory called project
- put the android.sbt file into this directory and run
sbt "gen-android android-21 scala.meetup TutorialApp"
- take a look at the files to understand what was generated
- create an avd and start an emulator
- run
sbt android:run
and you should see the MainActivity get started
- delete project/build.scala and add a build.sbt file
- you can then also delete project.properties (one file less to worry about)
- delete
src/androidTest
and createsrc/main/scala
and movesrc/main/java/.../MainActivity.java
tosrc/main/scala/MainActivity.scala
(and rename it to a scala file in the process) and deletesrc/main/java
- edit
MainActivity.scala
and port it to Scala - add hello_text in
src/main/res/values/strings.xml
and reference it insrc/main/res/layout/main.xml
- (optional - if you want to use EMACS/ensime) put the ensime.sbt file into the project directory and run
sbt gen-ensime
- run
sbt android:run
again and you should see the MainActivity to display the changed hello world text
- add the macroid dependencies to the build.sbt file (and/or check the macroid-starter repo for the most current version of a/the build.sbt file)
- edit AndroidManifest.xml to include min/targetSdkVersion
- edit MainActivity.scala to show two buttons and the text (and edit strings.xml accordingly)
- delete
src/main/res/layout
(this is not needed anymore) - run
sbt android:run
again and you should see the MainActivity to display two buttons. Try them ...