All Projects → bachhoan88 → Cleanarchitecture

bachhoan88 / Cleanarchitecture

Licence: apache-2.0
Android Kotlin Clean Architecture

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Cleanarchitecture

Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (+336.17%)
Mutual labels:  dagger2, architecture, viewmodel, architecture-components
Githubarchitecturecomponents
The implementation of Android "Architecture Components" sample explained by Google : https://developer.android.com/topic/libraries/architecture/guide.html
Stars: ✭ 302 (+221.28%)
Mutual labels:  dagger2, viewmodel, architecture-components
Android-Mvi-Starter
Android MVI Starter application
Stars: ✭ 19 (-79.79%)
Mutual labels:  dagger2, viewmodel, architecture-components
Retrokotlin
Simple Android app to show how unit testing with MockWebServer and Architecture Components (ViewModel + LiveData)
Stars: ✭ 55 (-41.49%)
Mutual labels:  dagger2, viewmodel, architecture-components
Superhero-App
🦸🏻‍♂️🦹🏻‍♀️Superhero app built with Kotlin, ViewModel, LiveData, ViewBinding, Room, and Hilt
Stars: ✭ 27 (-71.28%)
Mutual labels:  dagger2, viewmodel, architecture-components
DaggerExoPlayer
This repository demonstrates ExoPlayer injection with Dagger2
Stars: ✭ 58 (-38.3%)
Mutual labels:  dagger2, viewmodel, architecture-components
News Sample App
A sample news app which demonstrates clean architecture and best practices for developing android app
Stars: ✭ 334 (+255.32%)
Mutual labels:  dagger2, viewmodel, architecture-components
Android Architecture Components Kotlin
Sample used to practice Kotlin and Android Architecture Components.
Stars: ✭ 326 (+246.81%)
Mutual labels:  architecture, viewmodel, architecture-components
Gank
干货集中营 app 安卓实现,基于 RxFlux 架构使用了 RxJava、Retrofit、Glide、Koin等
Stars: ✭ 444 (+372.34%)
Mutual labels:  dagger2, viewmodel, architecture-components
Githubprojectbrowser
This is a sample Android Project that is based on Clean Architecture
Stars: ✭ 64 (-31.91%)
Mutual labels:  dagger2, viewmodel, architecture-components
Changedetection
Automatically track websites changes on Android in background.
Stars: ✭ 563 (+498.94%)
Mutual labels:  dagger2, viewmodel, architecture-components
Simple-Notes-Kotlin-App
✍️ Simple Note Making App use mvvm architecture , dagger , coroutines and navigation component. Features includes 🗒️ create , edit and ❌ delete notes
Stars: ✭ 40 (-57.45%)
Mutual labels:  dagger2, viewmodel, architecture-components
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (+131.91%)
Mutual labels:  dagger2, viewmodel, architecture-components
drawer-with-bottom-navigation-architecture
Sample android kotlin project with both drawer and bottom navigation together
Stars: ✭ 42 (-55.32%)
Mutual labels:  navigation, architecture, architecture-components
Movieapp Clean Architecture
Learning Project (Movie App) For Applying Android Architecture Components And Clean Architecture Using MVVM With Kotlin
Stars: ✭ 123 (+30.85%)
Mutual labels:  dagger2, viewmodel, 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 (-80.85%)
Mutual labels:  dagger2, viewmodel, architecture-components
News
A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
Stars: ✭ 774 (+723.4%)
Mutual labels:  dagger2, viewmodel, architecture-components
Kotlin Pokedex
🌀 A Pokedex app using ViewModel, LiveData, Room and Navigation
Stars: ✭ 1,156 (+1129.79%)
Mutual labels:  viewmodel, architecture-components, navigation
Blockchain Tracker
A blockchain market tracking app. Example implementation of reactive clean architecture and testing.
Stars: ✭ 30 (-68.09%)
Mutual labels:  dagger2, architecture-components
Android Kotlin Boilerplate
This project demonstrates Android Architecture Components (Viewodel, Livedata) and Dagger for dependency Injection in Kotlin
Stars: ✭ 28 (-70.21%)
Mutual labels:  dagger2, architecture

Android Kotlin Clean Architecture & Components Example

CircleCI codecov.io

This is a sample app & basic code that uses Clean Architecture & Components, that is part of a blog post I have written about how to architect android application using the Uncle Bob's clean architecture approach.

NOTE It is a relatively more complex and complete example so if you are not familiar with [Architecture Components][arch], you are highly recommended to check other examples in this repository first.

Introduction

Data-Flow

Structure

Work-Flow

Structure

Handler-Error-Flow

Structure

Domain Layer

  • Contains business model
  • Contains business RULEs
  • Repository interface adapt

Data Layer

  • Implementation Repository
  • Executor API data
  • Storage data to local: Share preferences, database, external storage
  • Mapper data model to domain model
  • Contains data service, third party data service

Presentation Layer

  • View (Activity/Fragment/Layout) Adapt data to view
  • Validate/Submit data input from view via UseCase

Base Code

Base code designed one Activity and multiple Fragment, using Navigation Component to UI navigate Use Dagger2 (version 2.23.2) for Dependencies Injection, You can easily switch to using Koin (I suggestion Dagger for big, super projects) Base code

  • Has created a flow that handles all of the corner cases, you can easily customize them via CleanException, it extends Throwable
  • Added Authorization, Interceptor easily handler and implementations for your project if needed
  • Use ktlint, kotlin-offical for check code conventions, you can run ./gradlew ktlint
  • Use jacoco for full Unit and Instrument test
  • Added basically circle-ci, gitlab-ci with some work-flows
  • Report bugs into Crashlytics via Timber.e

Building

Work from Android Studio 3.2 and above

Unit Test

You can easily write Unit Test up to 70% code coverage lines of code (LOC), if you write focus on

  • Data: API service, Local (database, share preferences), RepositoryImpl, Model Mapper
  • Domain: UseCases, Repository, Exception handlers
  • Presentation: ViewModel, Model Mapper

Libraries used


  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and automated testing.
    • AppCompat - Degrade gracefully on older versions of Android.
    • Android KTX - Write more concise, idiomatic Kotlin code.
    • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • Data Binding - Declaratively bind observable data to UI elements.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • LiveData - Build data objects that notify views when the underlying database changes.
    • Navigation - Handle everything needed for in-app navigation.
    • Room - Access your app's SQLite database with in-app objects and compile-time checks.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
    • WorkManager - Manage your Android background jobs.
  • UI - Details on why and how to use UI Components in your apps - together or separate
  • Third party
    • Glide for image loading
    • Kotlin Coroutines for managing background threads with simplified code and reducing needs for callbacks
    • ReactiveX library for composing asynchronous and event-based programs by using observable sequences.
    • Dagger2 for dependencies injection
    • Retrofit Type-safe HTTP client for Android
    • EasyPermission is a wrapper library to simplify basic system permissions logic when targeting Android M or higher.

Upcoming features

  • Build layer for library aar

  • Make design support for all application: styles, fonts, theme

  • Interested in seeing a particular feature of the Architecture or Base Code implemented in this app? Please open a new issue.

License

Copyright 2017 The Android Open Source Project, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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].