Mvvmcross: Interacting with android service
android, android-service, mvvmcross
Solution
In general I treat Android services, ios long running tasks and Windows background tasks as separate 'services' and they don't generally interact directly with the ViewModels, but instead interact via messaging, via data stores, etc. Specifically for Android, you may need to use View/Activity level hooks like service local binding (see Android - Service and Activity interaction)
When the background services share the same process (same memory space) as the ViewModels, then one thing that can seem a little awkward is initialising shared IoC and any required application singletons. However, generally this doesn't seem to be too hard to do - e.g. see questions like Using MvvmCross from content providers and activities and MvvmCross initialization
I haven't personally seen enough examples of this type of app to work out if there's a few common architectural patterns that could be supplied at an mvvm-platform level. I'd love to see more examples and more people talking about architectural ideas in this area.
Problem
I am thinking about using mvvmcross in one of the projects. For now I am just exploring the mvvmcross and going through different articles, but I cannot find anything relating to mvvmcross and android service. How to start, stop or bind to service in view-model. What is the "best" approach when dealing with services? Does anybody has a link or anything on the subject. Uros