codemotion-workshop
codemotion-workshop copied to clipboard
An example of how to create an Android app from scratch taking care of Architecture and Testing
Codemotion Workshop project preparation.
Slides
The slides used to facilitate the workshop can be found here.
Prerequisites
- Android SDK API 23
- Android SDK Build-tools
- Android Support Library
- Android Studio / IntelliJ + Plugin Scala (SBT)
- Emulator, Genymotion or physical device
- Ruby - Calabash
Steps:
cdto foldercodemotion-workshopandsbt- Open IntelliJ and File>Open>codemotion-workshop and double click in build.sbt
- SBT tab Click Refresh all SBT projects
- Project Structure>Project Settings>Modules>app>Dependencies>Module SDK Choose Android API 23 Platform
- Project Structure>Project Settings>Modules>app>Sources Select java from src/androidTest/ and press Test
Terminal
cd to folder codemotion-workshop and sbt
projects-> Command to list all modules
project hexagon
-
test-> Command to execute tests in hexagon -
compile-> Command to compile sources in hexagon -
clean-> Command to clean hexagon module
project adapters
-
test-> Command to execute tests in adapters -
compile-> Command to compile sources in adapters -
clean-> Command to clean adapters module
project app
-
devices-> Command to list connected devices -
android:run-> Command to install the app -
android:compile-> Command to compile sources in app -
android:test-> Command to execute androidTests in app -
android:clean-> Command to clean app module
Calabash - Ruby
- Install
rbenvandruby-build
- You can install
rbenvandruby-buildusing the Homebrew package manager on Mac OS X:
$ brew update
$ brew install rbenv ruby-build
- Add
rbenv initto your shell to enable shims and autocompletion.
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Use ~/.bashrc on Ubuntu, or ~/.zshrc for Zsh.
- Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.) Now check if rbenv was set up:
$ type rbenv
#=> "rbenv is a function"
- Install Ruby
# list all available versions:
$ rbenv install -l
# install a Ruby version:
$ rbenv install 2.2.3
- rbenv local
cdto foldercodemotion-workshopand
$ rbenv local 2.2.3
- Install Calabash
cdto foldercodemotion-workshopand
$ gem install calabash-android
- Run Calabash tests
cdto foldercodemotion-workshopand
$ calabash-android run ./modules/app/target/android/output/app-debug.apk
Following each step
We have included sbt-groll plugin so you can move around the Git commit history and see the progress.
cd to folder codemotion-workshop, sbt and groll initial
> groll next
That will take you to next commit and step. Use groll prev if you want to go back.