Should ViewModels communicate directly with services, or via repository?
The service is responsible for media streaming, and relies on external library.
Closing as it's out of the scope of the arch components, I recommend stackoverflow for these questions.
@JoseAlcerreca Where does the ServiceConnection belongs to? ViewModel or Activity/Fragment? What is the best place to call bindService()? UI components or AndroidViewModel? I think we should create a sample which is showing that how we can use Service with ViewModel. Or can we?
Where does the
ServiceConnectionbelongs to?ViewModelorActivity/Fragment? What is the best place to callbindService()? UI components orAndroidViewModel? I think we should create a sample which is showing that how we can useServicewithViewModel. Or can we?
Hi @iammert ! Do you have any news or update on this topic? :)
@iammert: i would be interested as well, please re-open this issue or please provide an answer on stackoverflow
@iammert I would be interested too. I wrote a question in stackoverflow as well.
Any guidance / solutions to this @iammert @RicoSchueppel @dglozano
You should rely less and less on Services. Target 26 and up kills them all. Then you have the foreground alternative but that just fit niche apps like voip on cruise ships apps (no internet at sea) or messaging apps on underdevelopment countries, where there is no Google push notifications.
The trend seems to be moving towards WorkManager but still fresh which means buggy
I am also stuck over this problem (https://stackoverflow.com/questions/60692553/creating-an-interface-between-websocketservice-and-viewmodel)
I need to bind my WebSocketService to viewmodel, but stuck at creating the interface.
Any help would be appreciated.
Most helpful comment
@JoseAlcerreca Where does the
ServiceConnectionbelongs to?ViewModelorActivity/Fragment? What is the best place to callbindService()? UI components orAndroidViewModel? I think we should create a sample which is showing that how we can useServicewithViewModel. Or can we?