Skip to content

This is showcase application that presents how we, at Klika, are building robust and production-ready applications. Showcase includes different patterns and best practices that we are using in our company including : architectural patterns, configuration handling, error handling, automated testing, crash reporting, and so on.

Notifications You must be signed in to change notification settings

esensar/android-template

 
 

Repository files navigation

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

About

This is showcase application that presents how we, at Klika, are building robust and production-ready applications. Showcase includes different patterns and best practices that we are using in our company including : architectural patterns, configuration handling, error handling, automated testing, crash reporting, and so on.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 99.9%
  • Shell 0.1%