I don't know if this is the right chnnel. Ok i have to develop a sync local to remote on Android. I have a local db room and i have to get data and send this data via cloud and update db room with new data from cloud.
I create a repository and of couse i have to use Coroutine but i don't know wich Scope because i can't use viewModelScope because sync have to work always and don't want to cancel when UI and viewModel are destroyes
not kotlin but kotlin colored 2
j
Jeff Lockhart
07/12/2023, 3:40 AM
You'll probably want to schedule the sync work using WorkManager.
g
Gioele Dev
07/12/2023, 3:52 AM
no sync starts every time user changes local data so when db changes.
j
Jeff Lockhart
07/12/2023, 3:54 AM
Yes, and it should be run with WorkManager when the sync is needed.