I am dealing with a youtube api to fetch subscriber count of channel, now as the subscriber count change every second I need to make the retrofit call every second. I am using android Jetpack components in my application, I want to know how to update the livedata every second, i.e. making the retrofit call every second.
Currently my application works fine using a Handler, Runnable and
handler.postDelayed(this, 1000)
But this handler uses UI thread, which is not good.
I have created a repository class and view model class.