Skip to content

Latest commit

 

History

History
87 lines (48 loc) · 3.54 KB

README.md

File metadata and controls

87 lines (48 loc) · 3.54 KB

Kotlin Android Template

This template provides starting point for Kotlin Android app, following Klika quality guidelines, with implemented authentication following OAuth2 standard.

Setup

Dependencies

  • Latest Android Studio
  • Homebrew (for setup script - required for installation of ktlint)
  • Ruby + overcommit gem
scripts/setup

This script will:

  • Setup overcommit hooks
  • Install ktlint (required for hooks)

Android lint is recommended to be run only on CI, since it can be slow for larger projects, while ktlint can be run on every commit.

Configuration

To get basic idea about configuration approach read 12factor.

Different build types are expected to have different configuration and it is stored in .properties files. Inside app module, by default, debug.properties and release.properties are expected. Example is provided in config-example.properties.

Getting started

Use Klika quality guidelines for general development references.

Kotlin styleguides

This project is following official Kotlin codestyle, which is also enforced by ktlint. It follows both codestyle from kotlinlang.org and Android Kotlin styleguide.

Naming guidelines

This project is following naming conventions from ribot android guidelines.

New feature

Use GitFlow development workflow with tests included.

Pull request quality gates

  • no conflicts with target branch
  • pass CI tests
  • code review approval

Tools

Networking with OkHttp + Retrofit

Networking is implemented via Retrofit, with Http client provided by OkHttp that provides easy API communication and response parsing using Gson.

Databinding + Android Architecture Components ViewModel

MVVM is implemented with help of databinding and ViewModel of Android Architecture Components.

Reactive with Kotlin coroutines Flow

Project is implemented with Kotlin Coroutines + Flow.

Dependency injection with Dagger2

All dependencies in application are injected using JSR-330(@Inject, @Singleton) annotations. Dagger2 is used to make all of it easier.

Quality gates

This project will run static code analyser on every commit and full test suite on git push.

Static code analyser

This template is using ktlint for static code analysis. It is also using default android lint. All offenses are automatically tracked and prevented on every commit. This feature is handled by Overcommit git hook manager.

Testing

We are using JUnit5 Framework.

Continuous Integration

AppCenter is recommended for CI.

Maintainers