Welcome to the Android MVVM+Hilt Blog Reading App repository! This project is a hands-on example of building a Blog Reading App using the Model-View-ViewModel (MVVM) architectural pattern and Dagger-Hilt dependency Injection. Dive into this practical project to enhance your Android development skills and get a taste of what you'll learn in the Android Dependency Injection with Hilt Course (Bengali). You can watch the course introduction and outline from here.
mvvm_app_demo.mp4
The Android MVP Blog Reading App showcases how to structure and build an Android app using MVVM architecture with Dependency Injection Hilt. As you explore this repository, you'll gain practical insights into clean code, separation of concerns, and best practices in Android app development.
This app showcases various features related to reading blogs, including:
- Viewing a list of blog posts
- Displaying blog post details
- Fetching blog posts from a remote server
- Manually provide depdency without library
- Dependency Injection Hilt implementation (master branch)
To get started with the project, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/hasancse91/android-mvvm-hilt-blog-app.git
-
Open the project in Android Studio.
-
Build and run the app on an emulator or physical device.
The key components of the MVVM architecture include:
- Model: Represents the data and business logic of the app.
- View: Displays the UI and handles user input.
- ViewModel: Acts as an intermediary between the Model and View, handling business logic and updating the observable field. Which observable field is being observed by View.
The MVVM architecture brings several benefits, including improved code maintainability, separation of concerns, and testability. Specially it overcomed the limitations of MVP architecture like: ViewModel reusability issue, lifecycle handle issue etc.
- Refactoring the MVVM project
- Adding dependencies for Hilt
- Annotate Application class using
@HiltAndroidApp
- Create
@Module
- Bind repository
- Make Activity class as
@AndroidEntryPoint
- Prepare
ViewModel
for injection field
Thank you for exploring the Android Blog Reading App project! If you have any questions or suggestions, please feel free to reach out.
Happy coding!