An application with Dagger 2, shared preference, retrofit API and Room storage. Each and every concept is implemented in separate activity for beginners.
In my previous Git repo I have provide Dagger 2 in simple steps. It is available here.
Here in this repo I've used shared preference, API calling(Retrofit) and persistance storage(Room DB) with the help of dependency injection(Dagger 2).
-
SimpleActivity.java:
- for simpleDagger 2
introduction and basic functionality (info available here) -
PreferenceActivity.java:
- for storing and retriving data fromSharedPreferences
Preferences and utils will be injected through dagger component.
NetworkActivity.java:
- for calling API usingRetrofit
Retrofit setup and call is done in NetworkModule and injected in activity thought dagger.
PersistenceActivity.java:
- for storing and retriving data fromRoom
Room setup and DAO is defined in PersistenceModule and injected in activity thought dagger.
Each specific component holds an respective custom scopes.