PresFeed is a demo app that demonstrates the MVVM architecture pattern in Android. It uses various technologies such as Hilt, Room, Navigation, LiveData, coroutines, Retrofit, Okhttp, Moshi, and unit testing.
PresFeed has two pages:
- Headlines page: This page shows a list of headlines from a specific news source.
- News detail page: This page shows the details of a news article.
To run the app, you need to clone the repository and open it in Android Studio. Then, you can build and run the app on an emulator or a physical device.
To use this app, you will need to obtain an API key from newsApi website and add it to the local.properties
file in the root directory of the project. Here's how:
- Open the
local.properties
file. - Add a new line to the file with the following format:
apikey="your_api_key_here"
. Replaceyour_api_key_here
with your actual API key. - Save the
local.properties
file.
PresFeed uses the following technologies:
- Hilt for dependency injection
- Room for database management
- Navigation for navigating between screens
- LiveData for observing data changes
- Coroutines for managing asynchronous tasks
- Retrofit for making API calls
- Okhttp for handling network requests
- Moshi for JSON parsing
- Glide for image loading and image caching
- Unit testing with JUnit, Mockito
PresFeed follows the MVVM (Model-View-ViewModel) architecture pattern. Here's a brief overview of the architecture:
- Model: This layer contains the data models and repository classes that manage the data.
- View: This layer contains the UI components such as Activities, Fragments, and XML layouts.
- ViewModel: This layer acts as a mediator between the View and Model layers. It contains the business logic of the app and provides data to the View layer.