Skip to content

nunobaba/android-app.g8

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android App in Scala

giter8 template to get an Android Set a Scala-based Android project up in a matter of seconds. BDD is possible through Specs2, installed as a plugin.

How to use

To use this template, g8 needs to be installed first. Read g8's readme.

All done? Now fire up your favorite shell and enter

g8 jberkel/android-app
cd <name-of-app>
sbt android:package-debug

What you get

Your android sbt project contains 2 subprojects:

  • MainProject
    • generated AndroidManifest.xml
    • Activity.scala (the "hello world" activity)
  • TestProject (tests)

Installing & Running

$ sbt
$ android:emulator-start <tab>
$ android:install-emulator

How to run unit tests (src/test/scala/*)

$ sbt
> test
[info] Specs:
[info] a spec
[info] - should do something
[info] Passed: : Total 1, Failed 0, Errors 0, Passed 1, Skipped 0

How to run integration tests (tests/src/main/scala/*)

The main apk under test needs to be installed first. Then:

$ sbt
> project tests
> android:install-emulator
> android:test-emulator
[info]
[info] my.android.project.tests.ActivityTests:.
[info] my.android.project.tests.AndroidTests:..
[info] Test results for InstrumentationTestRunner=...
[info] Time: 1.492
[info]
[info] OK (3 tests)

About

A g8 template for Android apps in Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%