=====================
This app uses the MVVM pattern
These are the APIs that this project includes
- Room
- LiveData
- ViewModels
- ViewBinding
- Navigation
- Hilt
- Google Map API
- Picasso
- Retrofit
- Pretty time
- Kotlin Coroutines
- Kotlin Flow
- Weather Bit
The database is created using Room and has two entities: City
and Forecast
. Room generates the corresponding SQLite table at
runtime.
The app has a Main Activity and two Fragments.
- The fist fragment displays the a list of cities where the user can add them on the searchBar using the Google API.
- The second fragment displays a city and the forecast for the next five days.
The Activity works with a ViewModel to do the following:
- subscribe to the emissions of the user name and update the UI every time there is a new City emitted
- notify the ViewModel when the "Update" button is pressed and pass a City with update values.
The ViewModel gets the source from the Repository class
Room guarantees that the observable query will be triggered on a background thread.
This project shows how to use view bindings in an activity and in fragments. InflateFragment
uses the inflate()
API and BindFragment
shows the less common bind()
API.
The app won't run unless you add the Google Key And RapidKey