Git Product home page Git Product logo

moviescatalog's Introduction

MoviesCatalog

Build Status codecov

database is 100% tested but does not count on coverage because Realm just can be tested on androidTest environment :(

An MVP App using Kotlin, Dagger-Android, RxJava2, Realm, Local cache with OkHttp, Mockito and Robolectric.

Top 50 movies from moviedb API. This app counts with local data persistence with Realm and temporarily local cache with OkHttp. Data are loaded in an infinite scroll list and can be filtered by genre.

Unit Tests & Test Coverage

I've used Robolectric to made my Activities and Presenters tests with no need to attach an Android Device or Emulator to it. I've created a test dagger's component using the test environment, to create a mock of my dependency injection graph.

./gradlew testDebug jacocoTestReportDebug runs unit tests with jacoco and creates a test coverage report (it can be found on MoviesCatalog/build/reports/jacoco/debug/index.html after running)

There are local persistence data tests in /androidTest folder because Realm just runs on a real or virtual Android device.

Roboelectric - Note for Linux and Mac Users

If you are on Linux or on a Mac, you will probably need to configure the default JUnit test runner configuration in order to work around a bug where Android Studio does not set the working directory to the module being tested. This can be accomplished by editing the run configurations, Defaults -> JUnit and changing the working directory value to $MODULE_DIR$. If you face any problem to run the tests, please, follow this setup on Building with Android Studio section.

Bonus Points

- The user should be able to save items as favourites, and these should be retained across app restarts, kill or catalog refresh. ✅

To accomplish this task I've choose persist the favorite movies data with a realm database.

- Work offline. Ability to download content and use it while offline. We love offline! ✅

To accomplish this task I've choose to persist the request data temporarily, through a local cache using okhttp client with retrofit. All requests are saved for 30 minutes and the app works with offline data during this time.

- The user should also be able to select one or more items and share the selection via ✅
- Infinite scroll / Lazy load of more items. ✅
- Add more filtering/sorting options (Year, Genre, keywords...) ✅
- The ability to provide smooth transitions between screens and states ✅

moviescatalog's People

Contributors

haroldolivieri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.