# android


10/10/2023, 10:22 AM
Hello, what would be the best way to synchronize local database with the cloud only in foreground every X seconds while user uses the app? Should I use Coroutines for this, or launch Worker in the coroutines, or would it be possible to do this via only Worker? Can I launch PeriodicWorker which would be active while in foreground, and when app goes to background, it will stop when the periodic work after it finishes? Thanks.
not kotlin but kotlin colored 5