Notice!!
- Add your
google-services.json
under/app
- You might have issue about can't get GPS location via mock location on Emulator. Change Location Mode to High Accuracy in Settings should work.
Keywords in this implementation:
- ViewModel/LiveData/Room
- Kotlin/rxjava2
- Unit test - junit/mockito/robolectric
- Others 3rd-party API - retrofit2/picasso/renaudcerrato:static-maps-api
Refer to the link if you can see the pic: https://drive.google.com/open?id=1M-OCdhPYnqwUkWvNlwUHRMYzI8snJn76
-
The data, domain, presentation layer are defined clearly. so we can get rid of complex dependencies between layers. You can also see this implementation are easy to test each layer separately.
-
I wrote the TrackAdapterTest as example to show how we can test the class with Mock and Robolectric.
-
For MainActivity and , we can mock it easily after replace the variable which in the MainActivity.inject() to Dagger Injection.
- Use 3rd-party library to handle http request, image cache loading and build static-maps URL easily.
-
Replaced variables in MainActivity and LocationTrackingService by Dagger Injection for testing easier.
-
Structure for keeping Locations is not efficient. Should be handled better
-
LocationTrackingService should change the variables to inject way for easy testing.
-
The other known issues were written in the code as comment.