Android app for the FightPandemics
- The app is written entirely in Kotlin and uses the Gradle build system
- To build the app, use the gradlew build command or use
Import Project
in Android Studio. - A Stable Version of 4.0 or newer is required and can be downloaded Here
- Open
FightPandemics-android
in Android Studio - Happy coding!
See the CONTRIBUTING file for guidelines on contributing.
The application uses Clean Architecture based on MVVM and Repository patterns. Implemented Architecture principles follow Google recommended Guide to app architecture
We kept logic away from Activities and Fragments and moved it to ViewModels. We observed data using LiveData and used the Data Binding Library to bind UI components in layouts to the app's data sources.
Android Jetpack is used as an Architecture but not limited to ViewModel, LiveData, Lifecycles, Navigation, Room and Data Binding. See a complete list in "Libraries used" section.
The application does network HTTP requests via Retrofit, OkHttp and GSON. Loaded data is saved to SQL based database Room, which serves as single source of truth and support offline mode. Paging library is used for data pagination online and offline.
Kotlin Coroutines manage background threads with simplified code and reducing needs for callbacks. Combination of Coroutines and Kotlin build in functions (transformation, collections) are preferred over RxJava 2.
Dagger 2 is used for dependency injection.
Glide is used for image loading and Timber for logging.
Android Jetpack is a set of components, tools and guidance to make great Android apps. They bring together the existing Support Library and Architecture Components and arranges them into four categories:
- Foundation - Components for core system capabilities, Kotlin extensions and support for
multidex and automated testing.
- AppCompat - Degrade gracefully on older versions of Android.
- Android KTX - Write more concise, idiomatic Kotlin code.
- Test - An Android testing framework for unit and runtime UI tests.
- Architecture - A collection of libraries that help you design robust, testable, and
maintainable apps. Start with classes for managing your UI component lifecycle and handling data
persistence.
- Data Binding - Declaratively bind observable data to UI elements.
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying database changes.
- Navigation - Handle everything needed for in-app navigation.
- Room - SQLite database with in-app objects and compile-time checks.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
- WorkManager - Manage your Android background jobs.
- Paging - Load and display small chunks of data at a time.
- UI - Details on why and how to use UI Components in your apps - together or separate.
- Animations & Transitions - Move widgets and transition between screens.
- Fragment - A basic unit of composable UI.
- Layout - Lay out widgets using different algorithms.
- Material - Material Components.
- Third party
- Kotlin Coroutines for managing background threads with simplified code and reducing needs for callbacks.
- Dagger 2 A fast dependency injector.
- Retrofit 2 A configurable REST client.
- OkHttp 3 A type-safe HTTP client.
- GSON A Json - Object converter using reflection.
- Glide Image loading.
- Timber A logger.
- https://proandroiddev.com/gradle-dependency-management-with-kotlin-94eed4df9a28
- https://proandroiddev.com/intro-to-app-modularization-42411e4c421e
- https://www.droidcon.com/media-detail?video=380845032
- https://proandroiddev.com/kotlin-clean-architecture-1ad42fcd97fa
- https://www.raywenderlich.com/3595916-clean-architecture-tutorial-for-android-getting-started
- http://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
- https://developer.android.com/guide/navigation/navigation-dynamic
- https://proandroiddev.com/navigation-with-dynamic-feature-modules-48ee7645488
- https://medium.com/androiddevelopers/patterns-for-accessing-code-from-dynamic-feature-modules-7e5dca6f9123
- https://hackernoon.com/android-components-architecture-in-a-modular-word-d0k32i6
Special thanks to all contributors 💜
FightPandemics is available under the MIT license. See the LICENSE file for more info.