Application which retrieves data from Webserver (via Retrofit), saves it into Room and get from it if user is offline.
There are applying MVVM architecture pattern and Dagger 2 example.
- Model is implemented as Repository pattern. Firstly it begins from internet connection checking. Consequently if it's alive we're retrieving data from the server (by using Retrofit 2) and inserting into the SQLite database. Otherwise we're trying to fetch data from the SQLite itself.
- View is realised as 2 fragments. First one contains RecyclerView, second one depends on clicks on recycler-items and finally displays detailed data fetched from the Model. It implements state saving reflected on configuration changes.
- ViewModel is responsible for transferring data between view and model.
-
- Implementation of dependency injection for communication between app modules
- AndroidInjector applying for injecting into View components
- Unit-testing simplifying
-
- getting data from server into pojo-classes
- storing data fetched from server. User get data here if he is offline
- managing asynchronous database and network queries
- using instead of callbacks
- providing light asynchronous operations - - observer-pattern implementation for View interaction
- - interactive displaying and click reflecting - replace basic operations with UI (e.g. findViewById() ) to the XML