Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

A clean architecture example. Using Kotlin Flow, Retrofit and Dagger Hilt, etc.

NotificationsYou must be signed in to change notification settings

ydhnwb/android-clean-architecture

Repository files navigation

A clean architecture example. Using Kotlin Flow, Retrofit and Dagger Hilt, etc.

Intro

Architecture means the overall design of the project. It’s the organization of the code into classes or files or components or modules. And it’s how all these groups of code relate to each other. The architecture defines where the application performs its core functionality and how that functionality interacts with things like the database and the user interface.

Clean architecture refers to organizing the project so that it’s easy to understand and easy to change as the project grows. This doesn’t happen by chance. It takes intentional planning.

Reference

  • If you want a db cache using room db,go here
  • This android app using backend fromthis repo
  • If you want tutorial how to create this app step by step, go to thisyoutube playlist.

Screenshots

Notes

I created this app just for example how to implement clean architecture on android.It really biased to my preference and experience. Also,clean architecture is not mandatory to do. If you feel that you/your team are taking so much benefit by implementing this design pattern, then go for it. Otherwise, don't use it or just modify to you/your team preferences.This app have little bug. If you go from FragmentA to FragmentB, then go back, the fragmentA re render again. I Know how to fix it but I dont have time to do it. Search for "retain fragment jetpack navigation", use the newest solution

Main Picture

There are 3 layer in this app.

Presentation LayerDomain LayerData Layer
your ui/viewentitydata source, dto
your viewmodelusecaserepository implementation
probably your extensionrepository interfaceyour library config(retrofit/room)
etc...etc..etc...

App Level Example

Presentation LayerSomething in BetweenDomain LayerData LayerOuter data layer
LoginActivity & LoginViewModel<- LoginUseCase -><- LoginRepository (interface) -><- LoginRepositoryImplementationDataSource

About

A clean architecture example. Using Kotlin Flow, Retrofit and Dagger Hilt, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp