All Projects → nuhkoca → libbra

nuhkoca / libbra

Licence: Apache-2.0 license
A currency tracker app demonstration. It refreshes currency list every single second based on the main currency. In addition to that, main currency is selectable.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to libbra

Android-Assignment
This assignment gives you basically a post list and its detail with comments.🚀
Stars: ✭ 32 (-28.89%)
Mutual labels:  retrofit2, architecture-components, navigation-architecture-component, viewbinding
movies
An example approach for modularization, reactive clean architecture and persistancy.
Stars: ✭ 110 (+144.44%)
Mutual labels:  dagger2, retrofit2, architecture-components, lifecycle-components
Superhero-App
🦸🏻‍♂️🦹🏻‍♀️Superhero app built with Kotlin, ViewModel, LiveData, ViewBinding, Room, and Hilt
Stars: ✭ 27 (-40%)
Mutual labels:  dagger2, retrofit2, architecture-components, viewbinding
flickr-android
A small sample app to showcase architecting app using Clean Architecture and MVVM
Stars: ✭ 25 (-44.44%)
Mutual labels:  dagger2, retrofit2, architecture-components
Retrokotlin
Simple Android app to show how unit testing with MockWebServer and Architecture Components (ViewModel + LiveData)
Stars: ✭ 55 (+22.22%)
Mutual labels:  dagger2, retrofit2, architecture-components
Githubprojectbrowser
This is a sample Android Project that is based on Clean Architecture
Stars: ✭ 64 (+42.22%)
Mutual labels:  dagger2, retrofit2, architecture-components
News
A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
Stars: ✭ 774 (+1620%)
Mutual labels:  dagger2, retrofit2, architecture-components
Fountain
Android Kotlin paged endpoints made easy
Stars: ✭ 175 (+288.89%)
Mutual labels:  dagger2, retrofit2, architecture-components
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (+182.22%)
Mutual labels:  dagger2, retrofit2, architecture-components
Stars
An android application build with a clean architecture approach and Star wars API
Stars: ✭ 54 (+20%)
Mutual labels:  dagger2, retrofit2, viewbinding
nytclient-android
This sample app is created to demonstrate the usage of Android Architecture Components with MVVM architecture
Stars: ✭ 24 (-46.67%)
Mutual labels:  dagger2, retrofit2, architecture-components
Android-MVVM-News-App
MVVM News Application with clean code architecture & android jetpack components.
Stars: ✭ 38 (-15.56%)
Mutual labels:  retrofit2, architecture-components, navigation-architecture-component
DaggerExoPlayer
This repository demonstrates ExoPlayer injection with Dagger2
Stars: ✭ 58 (+28.89%)
Mutual labels:  dagger2, retrofit2, architecture-components
Star Wars Shop
Simple project with clean architecture and android lifecycle
Stars: ✭ 37 (-17.78%)
Mutual labels:  dagger2, retrofit2, architecture-components
Price Tracker
Price Tracking Application - An experimental Kotlin Android project with complex android app requirements.
Stars: ✭ 80 (+77.78%)
Mutual labels:  dagger2, retrofit2, architecture-components
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-60%)
Mutual labels:  dagger2, retrofit2, architecture-components
News Sample App
A sample news app which demonstrates clean architecture and best practices for developing android app
Stars: ✭ 334 (+642.22%)
Mutual labels:  dagger2, retrofit2, architecture-components
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (+811.11%)
Mutual labels:  dagger2, retrofit2, architecture-components
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (+384.44%)
Mutual labels:  dagger2, retrofit2, architecture-components
AndroidMultiModuleCleanArchTemplate
An Android kotlin project template with Dagger2, Rx and Architecture Components
Stars: ✭ 33 (-26.67%)
Mutual labels:  dagger2, retrofit2, architecture-components

Libbra

Libbra CodeStyle Kotlin Version Gradle API License

Libbra Preview

Libbra is a sample app that allows to track currency exchanges. This app presents modern approach to Android application development using Kotlin and latest tech-stack.

This project is a hiring task by Revolut. The goal of the project is to demonstrate best practices, provide a set of guidelines, and present modern Android application architecture that is modular, scalable, maintainable and testable. This application may look simple, but it has all of these small details that will set the rock-solid foundation of the larger app suitable for bigger teams and long application lifecycle management.

Table of Contents

Development

Environment setup

First off, you require the latest Android Studio 3.6.0 (or newer) to be able to build the app.

Moreover, to sign your app for release, please refer to keystore.properties to find required fields.

# Signing Config
signing.store.password=<look>
signing.key.password=<look>
signing.key.alias=<look>
signing.store.file=<look>

Code style

To maintain the style and quality of the code, are used the bellow static analysis tools. All of them use properly configuration and you find them in the project root directory .{toolName}.

Tools Config file Check command Fix command
detekt default-detekt-config ./gradlew detekt -
ktlint - ./gradlew ktlintCheck ./gradlew ktlintFormat
spotless /spotless ./gradlew spotlessCheck ./gradlew spotlessApply
lint /.lint ./gradlew lint -

All these tools are integrated in pre-commit git hook, in order ensure that all static analysis and tests passes before you can commit your changes. To skip them for specific commit add this option at your git command:

git commit --no-verify

The pre-commit git hooks have exactly the same checks as Github Actions and are defined in this script. This step ensures that all commits comply with the established rules. However the continuous integration will ultimately be validated that the changes are correct.

Design

App support different screen sizes and the content has been adapted to fit for mobile devices and tablets. To do that, it has been created a flexible layout using one or more of the following concepts:

In terms of design has been followed recommendations android material design comprehensive guide for visual, motion, and interaction design across platforms and devices. Granting the project in this way a great user experience (UX) and user interface (UI). For more info about UX best practices visit link.

Moreover, has been implemented support for dark theme with the following benefits:

  • Can reduce power usage by a significant amount (depending on the device’s screen technology).
  • Improves visibility for users with low vision and those who are sensitive to bright light.
  • Makes it easier for anyone to use a device in a low-light environment.
Page Light Mode Dark Mode
Currency

Architecture

The architecture of the application is based, apply and strictly complies with each of the following 5 points:

Modules

Modules are collection of source files and build settings that allow you to divide a project into discrete units of functionality. In this case apart from dividing by functionality/responsibility, existing the following dependence between them:

The above graph shows the app modularisation:

  • :app depends on :rules.
  • :rules depends on nothing.

App module

The :app module is an com.android.application, which is needed to create the app bundle. It is also responsible for initiating the dependency graph and another project global libraries, differentiating especially between different app environments.

Rules modules

The :rules module is an com.android.library, basically contains lint checks for the entire project.

Architecture components

Ideally, ViewModels shouldn’t know anything about Android. This improves testability, leak safety and modularity. ViewModels have different scopes than activities or fragments. While a ViewModel is alive and running, an activity can be in any of its lifecycle states. Activities and fragments can be destroyed and created again while the ViewModel is unaware.

Passing a reference of the View (activity or fragment) to the ViewModel is a serious risk. Lets assume the ViewModel requests data from the network and the data comes back some time later. At that moment, the View reference might be destroyed or might be an old activity that is no longer visible, generating a memory leak and, possibly, a crash.

The communication between the different layers follow the above diagram using the reactive paradigm, observing changes on components without need of callbacks avoiding leaks and edge cases related with them.

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.
    • Data Binding - allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • ViewBinding - allows you to more easily write code that interacts with views.
    • 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.
    • 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.
  • Coil - image loading library for Android backed by Kotlin Coroutines.
  • Kotlinx Serialization - consists of a compiler plugin, that generates visitor code for serializable classes, runtime library with core serialization API and JSON format, and support libraries with ProtoBuf, CBOR and properties formats.
  • Timber - a logger with a small, extensible API which provides utility on top of Android's normal Log class.
  • and more...

Test dependencies

  • Orchestrator - allows you to run each of your app's tests within its own invocation of Instrumentation.
  • Espresso - to write concise, beautiful, and reliable Android UI tests
  • JUnit - a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
  • JUnit5 - a Gradle plugin that allows for the execution of JUnit 5 tests in Android environments using Android Gradle Plugin 3.5.0 or later.
  • Mockk - provides DSL to mock behavior. Built from zero to fit Kotlin language.
  • AndroidX - the androidx test library provides an extensive framework for testing Android apps.
  • and more...

Plugins

  • Ktlint - a pluging that creates convenient tasks in your Gradle project that run ktlint checks or do code auto format.
  • 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.
  • JUnit5 - a Gradle plugin that allows for the execution of JUnit5 tests in Android environments using Android Gradle Plugin 3.5.0 or later.
  • and more...

Author

Nuh Koca

Linkedin Twitter Medium Web

License

  • The preview images were created using 'Previewed' at Previewed
  • The currency and application icons were created at Iconscout
Copyright 2020 Nuh Koca

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].