Closed grine4ka closed 1 year ago
To avoid rapid API requests (not to overcome quotas) we need to cache data about teams and venues.
It's a good practice to update teams once a day (not more rapid).
Store date of last update to some preference and check it every time you try to get teams.
Alternatives for using dates: https://medium.com/nanogiants/handling-dates-on-android-1fccccde9d54 I can work with date using this library: https://github.com/Kotlin/kotlinx-datetime
Using Room library to cache data in a local database - https://developer.android.com/training/data-storage/room
Watch good examples of using Room in this repo https://github.com/android/nowinandroid/tree/main/core/database
Need to clear cached teams once a day
To avoid rapid API requests (not to overcome quotas) we need to cache data about teams and venues.
It's a good practice to update teams once a day (not more rapid).
Updating once a day
Store date of last update to some preference and check it every time you try to get teams.
Alternatives for using dates: https://medium.com/nanogiants/handling-dates-on-android-1fccccde9d54 I can work with date using this library: https://github.com/Kotlin/kotlinx-datetime
Useful links
Using Room library to cache data in a local database - https://developer.android.com/training/data-storage/room
Watch good examples of using Room in this repo https://github.com/android/nowinandroid/tree/main/core/database