How to Build a Note App with Jetpack Compose, MVVM, and Clean Architecture

preview_player
Показать описание
In this video, I will show you how to create a simple but powerful note app using some of the most modern and popular technologies and practices in Android development: Jetpack Compose, MVVM, and Clean Architecture.

You will learn how to:

Use Jetpack Compose to create beautiful and responsive user interfaces with less code and more flexibility
Implement MVVM (Model-View-ViewModel) design pattern to separate your app logic from your UI and improve testability and maintainability
Apply Clean Architecture principles to organize your code into layers of abstraction and dependency inversion
Use the Room database to store and manage your notes locally
Use Hilt for dependency injection and Coroutines for asynchronous operations
By the end of this video, you will have a fully functional note app that you can customize and extend according to your needs and preferences.

00:00 Intro
00:35 What will we build
02:00 Why Learn Clean Architecture
03:25 Starter Code
03:25 Starter Code
04:08 The Data Layer
18:40 The Domain Layer
24:40 Use Cases
38:00 Dependency Injection With Hilt
43:28 The presentation Layer: Home
01:14:05 Bookmark Screen
01:25:03 Detail Screen
02:04:17 Jetpack Compose Navigation
02:19:33 Bottom Bar setup
02:19:33 MainActivity Setup
02:30:30 Test Run
02:35:30 Polishing The App
Рекомендации по теме
Комментарии
Автор

you are perfect guy for youtube, because you did this kind of tutorials❤

nastenkaoo
Автор

cleanly architectured and well defined

RaghulS-nlwx
Автор

I am enjoying this - great job! You created a domain Repository interface (which is great), however it is using non-Domain types (Notes), which kind of defeats a portion of the purpose.
Normally there would be a "Notes" in the domain level that is used in the Repository interface that is free of all Room annotations, and a NotesEntity for Room that is used in the local database. A trivial mapper in this case would convert from and to NotesEntity and would reside in the data package and be used in the RepositoryImp. The point of this is that you could (for example) change backend databases without the other layers being aware of that.

ubersticks
Автор

The Note card corner detailing will look much better on various screen sizes if you use 'dp' instead of fixed pixels. Then apply half of that radius to the Column padding. This worked across many screen sizes I tested:

val cornerDp = 20.dp
...
RoundedCornerShape(
topStart = cornerDp,
bottomEnd = cornerDp
)
...
Card(...) {
Column( ... padding=(cornerDp/2) )

ubersticks
Автор

Hi. where can I see the list of dependencies?

edxjpyw
Автор

Question: Do we really need to launchIn(viewmodelScope) in the HomeViewModel and the BookmarkViewModel for querying flows() which do not require explicit coroutine scopes. If it is necessary to require a scope in the caller, then the UseCase (and/or the Repository) should have declared entry points as "suspend" to enforce this (like the deleteNote() )

ubersticks