grine4ka / footea

Application to stay at the cutting edge of android development
MIT License
0 stars 0 forks source link

Add caching to DB #34

Closed grine4ka closed 1 year ago

grine4ka commented 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).

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

grine4ka commented 1 year ago

Need to clear cached teams once a day