A sample Android app that displays the top 100 music albums across all genres using Apple’s RSS generator found here: https://rss.applemarketingtools.com/.
This project follows the Clean Architecture principles with the MVVM (Model-View-ViewModel) pattern in the presentation layer. Clean Architecture allows for a separation of concerns, making the codebase more maintainable, testable, and scalable. The MVVM pattern helps in organizing the code and provides a clear separation between the UI and business logic.
- 100% Kotlin: Utilized for all aspects of the application.
- Coroutines + Flow: Used for managing asynchronous tasks and data streams efficiently.
- Hilt: Integrated for dependency injection, making the code more modular and easier to test.
- MVVM with state management: Ensures a clear separation between the UI and the business logic.
- Jetpack Compose: Utilized for building the UI declaratively.
- Navigation with Compose: Handles the navigation logic within the app.
- Room Persistence: Constructs a local database to cache data, improving the app's performance and offline capabilities.
- Retrofit2 & OkHttp3: Constructs the REST APIs for network communication.
- Gson: Simplifies JSON parsing into Kotlin objects.
- Coil: Used for efficient image loading and caching.
- Clean Architecture:
- Chosen for its ability to separate concerns and create a scalable and testable codebase.
- Layers include Presentation, Domain, and Data, each with distinct responsibilities.
- MVVM Pattern:
- Enhances separation of concerns by decoupling the UI from the business logic.
- ViewModel manages the UI-related data, making the UI code cleaner and more maintainable.
- Jetpack Compose:
- Selected for its modern approach to building UIs, which is more intuitive and concise compared to XML-based layouts.
- Allows for reactive programming, where the UI automatically updates when the underlying data changes.
- Hilt for Dependency Injection:
- Simplifies the process of providing dependencies, making the code more modular and easier to test.
- Coroutines and Flow:
- Utilized for their ability to handle asynchronous tasks and manage data streams efficiently.
- Coroutines provide a way to write asynchronous code that is sequential and easy to understand.
- Displays a list of top albums retrieved from a remote source.
- Provides detailed information about a selected album.
- Allows users to go to iTunes store.
- data: Contains data sources, repositories, and models.
- domain: Includes use cases and domain models.
- presentation: Holds UI-related classes such as Activities, Fragments, ViewModels, and Compose UI components.
- di: Contains dependency injection setup and modules.
-
AlbumsRepository:
- Responsible for fetching data from the remote API and local database.
-
GetTopAlbumsUseCase:
- A use case that encapsulates the logic for retrieving the top albums.
-
AlbumsViewModel:
- Manages the state of the UI, interacts with use cases, and provides data to the UI components.
-
TopAlbumsScreen:
- A Composable function that displays the list of top albums.
-
AlbumDetailsScreen:
- A Composable function that displays detailed information about a selected album.
- Android Studio Bumblebee or higher.
- Kotlin 1.5 or higher.
- Clone the repository:
git clone https://github.com/MohamedE610/MusicAlbums.git
- Open the project in Android Studio.
- Build the project to install dependencies.
- Connect an Android device or start an emulator.
- Run the project from Android Studio.
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.