MVVM
- Android Architecture Components: LiveData, ViewModel, AppCompat, Android KTX
- Image loading: Glide
- UI component: Material
- View binding: Data Binding
- Dependency injector: Hilt
- Networking: Retrofit
- Unit testing: JUnit4, Mockito, Arch core testing (InstantTaskExecutorRule)
- UI testing: Espresso
- Build configuration : Kotlin DSL
- Full list: https://github.com/Th3Alch3m1st/wunderfleet/blob/master/buildSrc/src/main/java/Dependencies.kt
- ViewModel separate UI and Data layer. ViewModel allow data to survive configuration changes and improve testabilities.
- Jetpack LiveData is a lifecycle aware component, so it can avoid memory leaks and unwanted null pointer exception.
- Jetpack DataBinding to bind the layouts views and it's null safe.
- Use Navigation architecture components for navigation and use navigation safe args gradle plugin for argument passing to ensure safe argument pass
- Use Kotlin DSL for gradle management - it help better gradle management in multi module project. And increase readability, provide code navigation and auto suggestions
- Write Unit test and UI test to ensure app stability and performance
- Write some infix function to increase unit test redability
- Add documentation in UI test to explain test scenario and write short comment for unit test
- Could have used coroutine over RX, it is lighter than RX and has better testing support. For example - Coroutine support flow. Flow can handle back pressure, it can provide better support when need to test something inOrder for example loader show/hide. Live data doesn't support back pressure hence test fail time to time due to this.
- I have user lastLocation from FusedLocationProviderClient class to get user location, could have used requestLocationUpdates for location tracking on user movement
- Could have used a separate viewmodel for car list map and car details fragment. Currently I shared same viewmodel instance in two different fragment, it is better for performance but break single responsibility and interface segregation rule from SOLID rule.
- Could have cache network call, since it's a static api call. But it wouldn't applicable for real scenario, because car location will be updated frequently.
- Android Studio Arctic Fox | 2020.3.1 Patch 3
- Gradle 7.0.2