This is a sample movie app that uses Android Architecture Components with Dagger 2.
The app is composed of 2 main screens.
Allows you to search movies on themoviedb.
Each search result is kept in the database in Movie
table.
Each time a new page is fetched, the same Movie
record in the
Database is updated with the new list of repository ids.
NOTE The UI currently loads all Movie
items at once, which would not
perform well on lower end devices. Instead of manually writing lazy
adapters, we've decided to wait until the built in support in Room is released.
This fragment displays the details of a move and its similars.
You can open the project in Android studio and press run.
The project uses only instrumentation tests that run on the device. To run and generate a coverage report, you can run:
./gradlew fullCoverageReport
(requires a connected device or an emulator)
The projects uses Espresso for UI testing. Since each fragment is limited to a ViewModel, each test mocks related ViewModel to run the tests.
The project creates an in memory database for each database test but still runs them on the device.
ViewModel Tests Each ViewModel is tested using local unit tests with mock Repository implementations.
Each Repository is tested using local unit tests with mock web service and mock database.
The project uses MockWebServer project to test REST api interactions.
- Android Support Library
- Android Architecture Components
- Android Data Binding
- Dagger 2 for dependency injection
- Retrofit for REST api communication
- Glide for image loading
- Timber for logging
- espresso for UI tests
- mockito for mocking in tests