I recommend this structure for basic projects that are not extensive.
This project is intent to provide a template with basic MVVM architecture framework.
Advantages:
- Simple and easy to read
- The project has hilt integration
- The project has Navigation Component integration
- base: Base class for View and ViewModel instances.
- data: It contains all the data accessing and manipulating components.
- di: The directory will contain the classes responsible for dependency injection.
- domain: The directory contains all rules.
- ui: View classes along with their corresponding ViewModel in presentation.
- util: Utility classes.
The main players in the MVVM pattern are:
-
View: informs the ViewModel about the user’s actions
-
ViewModel: exposes streams of data relevant to the View
-
Model: abstracts the data source. The ViewModel works with the DataModel to get and save the data
The MVVM pattern supports two-way data binding between the View and ViewModel and there is a many-to-one relationship between View and ViewModel.
- Integration of Retrofit.
- Integration of Repository Pattern.
- Integration of UseCase.
- Example of a HTTP call.
- Add some unit tests.
- Kotlin
- Fragment KTX
- Android Architecture Components
- Coroutines
- Hilt
- Flow
- LiveData
- Retrofit
- Coil
- Navigation Component
- Android Util
- All contributions are welcome! Please fork this repository and contribute back using pull requests.
Don't forget to star ⭐ the repo it motivates me to share more open source