fefi95 / javaday-app

A simple calculator to teach the MVP pattern for the JavaDay Ecuador conference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaDay App - Calculator

A simple calculator on Android for the talk Create a testable Android App and don't fail trying: the MVP pattern on the JavaDay Ecuador conference.

The project has two implementations of the same Activity: One not using the MVP pattern (CalculatorActivity) and another using the patten (CalculaterActivityMVP)

Run the App

Set up an emulator

  1. Download the android system image. For example, if you want the android-22 image, do:
sdkmanager "system-images;android-22;default;armeabi-v7a"
  1. Set up the emulator with the same image of the previous step.
avdmanager create avd -n <name_of_device> -k "system-images;android-22;default;armeabi-v7a"

To know the complete list of android system images run sdkmanager --list

Build

This project uses Gradle for package managing. To build it, use the following command on the root folder of your project:

./gradlew androidDependencies

To build and install the app on a running emulator:

emulator -avd <name_of_device> & # Run emulator on the background
./gradlew installDebug 

To install on a running emulator and existing APK:

emulator -avd <name_of_device> &
adb install path/to/your_app.apk

Test

Once you build the project, you can run the tests:

Unit test

./gradlew test

Note: Keep in mind that this command will also run the linter

Instrumentation tests

Once you have done an emulator set up, launch it on the background and run the tests:

emulator -avd <name_of_device> &
./gradlew connectedAndroidTest

Recomendation: Use Android Studio to ease the process of Running and testing the app.

Some dependencies

For development:

For testing:

See Gradle file for more information

About

A simple calculator to teach the MVP pattern for the JavaDay Ecuador conference


Languages

Language:JavaScript 53.0%Language:CSS 29.0%Language:HTML 15.9%Language:Java 2.1%