/deckard-kotlin

A simple template project for test-driven Android development using Kotlin and Robolectric

Primary LanguageKotlinThe UnlicenseUnlicense

Deckard

Build Status

Deckard is the simplest possible Kotlin Android application project that uses Robolectric for testing and Gradle to build. It has one Activity and a single Robolectric test of that Activity.

Deckard imports easily into the latest editions of Android Studio with minimal setup.

Setup

Note: These instructions assume you have a Java 1.8 JDK installed.

To start a new Android project:

  1. Install Android Studio 2.1.

  2. Download Deckard-Kotlin as a zip here and then extract it on your dev machine.

  3. Import the template into Android Studio by clicking "Import project" and selecting the project directory.

  4. Change the names of things from 'Deckard' to whatever is appropriate for your project. Package name, classes, build.gradle, and the AndroidManifest are good places to start.

  5. Build an app. Win.

Running on the command line

  1. In the project directory you should be able to run the Robolectric tests:
./gradlew test
  1. Finally you can build a debug .apk of the project for installation on phones:
./gradlew assemble

This will output the file to build/outputs/apk/*-debug.apk