DEV Community

Cover image for Sample Android Components Architecture
Madalin Valceleanu
Madalin Valceleanu

Posted on • Updated on

Sample Android Components Architecture

Sample Project that presents modern, 2019 approach to Android application development using Kotlin, MVVM architecture, single Activity pattern, latest tech-stack: androidx, gradle-dsl, dynamic-features, retrofit, coroutines, live data, room, paging, dagger and more..

link: https://github.com/VMadalin/kotlin-sample-app

Tech-stack

This project takes advantage of many popular libraries, plugins and tools of the Android ecosystem. Most of the libraries are in the stable version, unless there is a good reason to use non-stable dependency.

Dependencies

  • Jetpack:
    • Android KTX - provide concise, idiomatic Kotlin to Jetpack and Android platform APIs.
    • AndroidX - major improvement to the original Android Support Library, which is no longer maintained.
    • Benchmark - handles warmup, measures your code performance, and outputs benchmarking results to the Android Studio console.
    • Data Binding - allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • Lifecycle - perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.
    • LiveData - lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services.
    • Navigation - helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.
    • Paging - helps you load and display small chunks of data at a time. Loading partial data on demand reduces usage of network bandwidth and system resources.
    • Room - persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
    • ViewModel - designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.
  • Coroutines - managing background threads with simplified code and reducing needs for callbacks.
  • Dagger2 - dependency injector for replacement all FactoryFactory classes.
  • Retrofit - type-safe HTTP client.
  • Glide - image loading and caching library for Android focused on smooth scrolling.
  • Moshi - makes it easy to parse JSON into Kotlin objects.
  • Timber - a logger with a small, extensible API which provides utility on top of Android's normal Log class.
  • Stetho - debug bridge for applications via Chrome Developer Tools.
  • and more...

Test Dependencies

  • UIAutomator - a UI testing framework suitable for cross-app functional UI testing across system and installed apps.
  • Espresso - to write concise, beautiful, and reliable Android UI tests
  • Robolectric - industry-standard unit testing framework for Android.
  • JUnit - a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
  • Mockito - most popular Mocking framework for unit tests written in Java.
  • AndroidX - the androidx test library provides an extensive framework for testing Android apps.
  • and more...

Plugins

  • Ktlint - an anti-bikeshedding Kotlin linter with built-in formatter.
  • Detekt - a static code analysis tool for the Kotlin programming language.
  • Spotless - a code formatter can do more than just find formatting errors.
  • Versions - make easy to determine which dependencies have updates.
  • SafeArgs - generates simple object and builder classes for type-safe navigation and access to any associated arguments.
  • Jacoco - code coverage library
  • and more...

Top comments (0)