dataSource
: storage implementationsdi
: dependence injections configurationsmodel
: application data modelsnetwork
: configurations to create communicationsrepository
: middleware between viewModels and dataui
: layouts implementations (activities/fragments)worker
: services that works in background
- Dagger : dependence injections
- Picasso : load and cache images by url
- Retrofit : make http communications
- RxJava : to be more easy asynchronous implementations
- Play Service Location : get user location
- WorkManager : schedule works in background
- Shared Preference : save only last weather
Basically, the app configures all services and tries to start the WeatherWork (background service) as a PeriodicWork if it is not running yet.
The work will save the new weather obtained in local data storage. The view will get the weather from storage. All data are stored using SharedPreference because for this situation we need to save only last Weather but in case to improve the solution it is possible to change UserPreference to another likes Room, for example, inside DataStorageRepository.