The project is about CATs. This is an effort to use all the implementation best practices to build a simple app. Though its written in JAVA and not in Kotlin, focus is on implementation tools rather than the syntax.
Fetch the worlds finest cats (animal) and show them in a grid. Application should persist for viewing pleasure next time, with a possibility to fetch new ones with a refresh button. Also, using the same codebase, generate an app only for kitten images, this is necessary because kittens are cuter :)
- Dependency injection
- Data binding
- Architecture components recommended by Google
- Room Database
- HTTP connections
- Android architecture components for better code architecture
- Dagger 2 for dependency injection.
- Android Room Database for database storage
- Glide for image download and cache
- Retrofit and OkHttp for network
- Android Support and Design Libraries
- Android Constraint layout
- Espresso for instrumental testing
I was always of an opinion to use minimal libraries and have maintained code for HTTP connections to database, but these are really powerful and are straight from Google, which in my opinion gives them a first class citizenship in projects. Plus the amount of boilerplate code it removes is outstanding.
- binding
Adapters to be used for data binding
- core
Hosts core controllers to use across the app
- db
Anything and everything required for Room Database, except entities.
- di
Dependency injection related classes for Dagger
- models
Models including database entities
- network
Service class for HTTP connections, response interfaces, and actual network fetch tasks.
- ui
UI Controllers including activities, fragments and respective Dagger components.
- util Utility classes.
CatsFragment.java | |
---|---|
UI Controllers (CatsFragment.java) | |
View Model (CatsViewModel.java) | |
Repository (CatsRepository.java) | |
Cats Dao and CatsDatabase | FetchCatsTask using CatsService |
As suggested by Google Architecture Components, components can only access component below them and is accessed by the one on top of them