Hey, I want to use a background coroutine that calls some API each X seconds, where should I call it if I’m using few activities and view models and I want to start this job in one place and what should scope should I use? Thank you!
😶 2
r
Remon Shehata
05/11/2022, 12:25 PM
you might consider using
WorkManger
a
Amit
05/14/2022, 2:35 PM
workmanager is likely better suited for longer interval processing. IF Shira is going for updates in units of seconds, I probably would have some appScoped manager or repository fetch within a hot flow, that has while loop iterate the api call every intervals