A demo Android app based on The New York Times API. The goal of the project is to integrate the latest Android tools and libraries for learning purposes.
The app was designed from the start to include some interesting aspects of Android development, namely:
-
Multiple screens of the same flow: Both the SearchFragment and SearchResultFragment belong to the same flow. This was implemented using a shared ViewModel scoped to a navigation graph.
-
Multiple back stacks: The app's primary navigation component is a bottom navigation bar. This was implemented using the latest version of the Jetpack Navigation Component which supports this functionality out of the box.
-
ViewModel with runtime constructor arguments: Many ViewModels in this app require this, for example, ArticleDetailsViewModel. This was implemented using Dagger's assisted injection.
-
Configuration changes and process death: Handled using Jetpack ViewModel and SavedStateHandle.
-
One-off events (transient events): Implemented using Kotlin Flow.
-
Passing data to previous destinations: An example of this is the ArticleDetailsFragment and SortByDialog. This was implemented using the Navigation Component NavBackStackEntry.
- MVVM Architecture
- Jetpack Navigation Component
- Coroutines and Flow
- Dagger
- JetPack ViewModel
- Retrofit
- Testing
- JUnit 4
- TestParameterInjector - For parameterized tests
- Kotest Assertions Library
- Turbine - For testing Kotlin Flows