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

Overview

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.
You might also like...
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

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

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

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

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

Bego Chat is chat application in Kotlin and Firebase with the following features: last seen , user status like typing ,online and last seen with MVVM pattern and clean architecture

Compose ChatApp(Bego Chat) Bego Chat is Compose chat application in Kotlin and Firebase with the following features: sending all file types and abilit

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

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

[ApiLibrary] Duckie Architecture Sample Project: 무료 API 모음
[ApiLibrary] Duckie Architecture Sample Project: 무료 API 모음

[ApiLibrary] Duckie Architecture Sample Project 이 프로젝트는 public-api 로 부터 무료 API 들을 조회해서 보여주는 간단한 앱 입니다. 총 1천개가 넘는 무료 API 들을 보여줍니다. 덕키 아키텍처 샘플 용도로 제작됐습니

Comments
  • Update request permission.

    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(this@MainFragment::class.simpleName,"Permission status: Granted")
                        }
                        PermissionStatus.Denied -> {
                            Timber.i(this@MainFragment::class.simpleName,"Permission status: Denied")
                            requestRuntimePermissions(PermissionStatus.Denied)
                        }
                        PermissionStatus.ShowRationale -> {
                            Timber.i(this@MainFragment::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")
            }
        }
    
    opened by tridhm-3108 1
Owner
Nguyễn Hùng An
Nguyễn Hùng An
Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that scaffolds your app and includes a server and build system.

What is it? Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that sca

reapp 3.4k Nov 20, 2022
This Project for how to use MVVM , state flow, Retrofit, dagger hit, coroutine , use cases with Clean architecture.

Clean-architecture This Project for how to use MVVM , state flow, Retrofit, dagger hit, coroutine , use cases with Clean architecture. Why i should us

Kareem Aboelatta 10 Dec 13, 2022
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

Hisham 20 Nov 19, 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.

Mr.Sanchez 176 Jan 4, 2023
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

AbolfaZl RezaEi 4 Jun 8, 2021
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

Yasser AKBBACH 0 Jan 8, 2022
🍭 GithubSearchKMM - Github Repos Search - Android - iOS - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Dependency Injection, shared KMP ViewModel, Clean Architecture

GithubSearchKMM Github Repos Search - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Depend

Petrus Nguyễn Thái Học 50 Jan 7, 2023
🚀 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.

Mr.Sanchez 114 Dec 26, 2022
Sample Project with Clean Architecture for demonstrating using Kotlin Flows for fetching User Location and networking.

Nearby-Places-Foursquare-Android Getting Nearby Places using Foursquare API API's Used from FourSquare Get Key from Foursquare site. NearBy places Her

Abhishek Dubey 5 Nov 30, 2022
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

Mert Toptas 132 Jan 2, 2023