A sample application that build with combine use Clean Architecture framework and Github API

Last update: Aug 12, 2022

The Github Example

Introduction

  • This is a sample application that build with combine use Clean Architecture framework and Github API (https://developer.github.com/v4/) for request and showing the information
  • This is an update from v1 sample with using Hilt and Coroutines replace for Dagger v2 and RxJava.

User interface

The UI will have three parts: User information, page information and repos information in same a list.

UI

github_sample.mp4

How to build

  • Check out the project.
  • Use Android Framework from 3.5.x or greater for compile and run.

Framework

This example use Clean Architecture approach for build project. (https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)

Data-Flow

Structure

Work-Flow

Structure

Libraries

  • 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
    • Coroutines A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.
    • Hilt 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.
    • CircleImageView a fast circular ImageView perfect for profile images.
    • LeakCanary a memory leak detection library for Android.
    • Shimmer an Android library that provides an easy way to add a shimmer effect to any view in your Android app.

GitHub

https://github.com/hungan1409/Github-Sample-Clean-Architecture-v2
You might also like...

FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

This repository contains a FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

Aug 4, 2022

Android application showcasing the MVVM architecture, Clean code using Kotlin, Coroutine, Flow and databinding.

Android application showcasing the MVVM architecture, Clean code using Kotlin, Coroutine, Flow and databinding.

Code4Lyst Android application showcasing the MVVM architecture, Clean code using Kotlin, Coroutine, Flow and databinding. App Architecture MVVM CleanC

Nov 29, 2021

Rick-and-morty-app - Android mobile application development with clean architecture

Rick-and-morty-app - Android mobile application development with clean architecture

Android - Rick And Morty App MVVM architecture Dependency Injection (Dagger) Ret

Jan 27, 2022

Android sample application based on Andorid architecture

Android sample application based on Andorid architecture

Gitgle Gitgle(Github + Google) is simple github user search application, using G

Jan 22, 2022

Pokemon App is a sample Pokemon application based on MVVM architecture.

Pokemon App is a sample Pokemon application based on MVVM architecture.

Pokemon App Pokemon App is an Application based on Modern Android tech-stacks and MVVM Architecture. Techs Used 💻 100% Kotlin based Coroutines + Flow

Jan 17, 2022

Delish, a Food Recipes App in Jetpack Compose and Hilt based on modern Android tech-stacks and MVVM clean architecture.

Delish, a Food Recipes App in Jetpack Compose and Hilt based on modern Android tech-stacks and MVVM clean architecture.

Delish Screens Tech stack & Open-source libraries 100% Kotlin based + Coroutines + Flow for asynchronous. Dagger Hilt 2.37 Accompanist JetPack Jetpack

Jul 31, 2022

Workout Journal is a mobile app based on Multi-Module and Clean Architecture for those who want to track their progress over a workout and a calendar period.

Workout Journal is a mobile app based on Multi-Module and Clean Architecture for those who want to track their progress over a workout and a calendar period.

Workout-Journal Workout Journal is a mobile app for those who want to track their progress over a workout and a calendar period. The app allows you to

Apr 8, 2022

Built with Jetpack compose, multi modules MVVM clean architecture, coroutines + flow, dependency injection, jetpack navigation and other jetpack components

RickAndMortyCompose - Work in progress A simple app using Jetpack compose, clean architecture, multi modules, coroutines + flows, dependency injection

Jul 13, 2022

To illustrate the clean architecture and modularisation with other components.

CleanNews A news app that provides data from mediastack API using clean architecture, kotlin coroutines, architectural pattern (MVI) with Mavericks. .

Feb 13, 2022
Comments
  • 1. Update request permission.

    • Update request permission.
    • Cách dùng:
    • Tạo biến xử lý call back sau khi được cấp quyền.
    private val permissionsLauncher by requestPermissionLauncher { status ->
                    when(status) {
                        PermissionStatus.Granted -> {
                            Timber.i([email protected]::class.simpleName,"Permission status: Granted")
                        }
                        PermissionStatus.Denied -> {
                            Timber.i([email protected]::class.simpleName,"Permission status: Denied")
                            requestRuntimePermissions(PermissionStatus.Denied)
                        }
                        PermissionStatus.ShowRationale -> {
                            Timber.i([email protected]::class.simpleName,"Permission status: ShowRationale")
                            requestRuntimePermissions(PermissionStatus.ShowRationale)
                        }
                    }
                }
    
    • Các quyền khi yêu cầu cấp quyền:
    override fun getPermissionsArray(): Array<String> {
            return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                arrayOf(Manifest.permission.ACCESS_FINE_LOCATION)
            } else {
                arrayOf()
            }
        }
    
    • Handle các action khi show cấp quyền:
    override fun requestRuntimePermissions(permissionStatus: PermissionStatus?) {
            when(permissionStatus)
            {
                /*
                * To help find situations where the user might need an explanation,
                * Android provides a utility method, shouldShowRequestPermissionRationale().
                * This method returns true if the app has requested this permission previously and the user denied the request.
                * */
                null ->{
                    var shouldProvideRationale = false
                    for (permission in getPermissionsArray()) {
                        if(ActivityCompat.shouldShowRequestPermissionRationale(requireActivity(), permission))
                            shouldProvideRationale = true
                    }
                    if (shouldProvideRationale)
                        PermissionStatus.ShowRationale
                    permissionsLauncher.launch(getPermissionsArray())
                }
    
                PermissionStatus.ShowRationale -> {
                    // Permission Rationale
                }
                PermissionStatus.Denied ->{
                    // Permission Denied
                }
                PermissionStatus.Granted ->{
                    // Permission Granted
                }
            }
        }
    
    • Gọi requestRuntimePermissions() để xin cấp quyền
    • Gọi super().permissionApproved() để kiểm tra các quyền đã được cấp chưa.
    • Có thể xử lý callback cấp quyền bằng hàm có sẵn (đã deprecated):
     /**
         * Handles the callback from the OAuth sign in flow, executing the post sign in function
         * TODO replace this function to result launcher
         */
        override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
            when(resultCode){
                AppCompatActivity.RESULT_OK -> Timber.i(this::class.simpleName, "Permission: RESULT_OK")
            }
        }
    
    Reviewed by tridhm-3108 at 2022-08-04 09:19
Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Unit tests etc.
Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Unit tests etc.

MoneyHeist-Chars Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Room

Jul 25, 2022
Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.
Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

Aug 13, 2022
MVIExample - A sample app showing how to build an app using the MVI architecture pattern
MVIExample - A sample app showing how to build an app using the MVI architecture pattern

MVIExample A sample app showing how to build an app using the MVI architecture p

Jan 8, 2022
ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture.
ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture.

ATH Sample ATH Sample is a sample Authentication and Authorization Application with Kotlin Language and MVVM architecture. Overview ATH Sample is a sa

Jun 8, 2021
🚀 Sample Android Clean Architecture on JetRorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack with Compose.
🚀 Sample Android Clean Architecture on JetRorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack with Compose.

Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

Aug 8, 2022
Sample Android Clean Architecture on App focused on written in Kotlin, following best practices using Jetpack with Compose.
 Sample Android Clean Architecture on App focused on written in Kotlin, following best practices using Jetpack with Compose.

Rick And Morty Jetpack Compose Sample App Table of Contents About the Project Architecture Features Environment Setup Contact About The Project This S

Jul 27, 2022
A sample project demonstrating clean architecture in an Android app
A sample project demonstrating clean architecture in an Android app

Android Clean Architecture Sample A sample project demonstrating clean architecture in an Android app Tech stack Kotlin Coroutines Flow Jetpack App St

Jul 7, 2022
Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow
Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow

ClearScoreDemo Skeleton project for showing the architecture of Android project using MVVM, Clean architecture and Kotlin coroutine Flow App Architect

Mar 6, 2022
Note taking app using SOLID principles and CLEAN architecture patterns. Uses Room database, MVVM, Use cases

ShoppingNotes Note taking app using SOLID principles and CLEAN architecture patt

Dec 27, 2021
A fork of our clean architecture boilerplate, this time using the Android Architecture Components

Android Clean Architecture Components Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have swi

Aug 10, 2022