Mvvmcross: interaction with the android service

I am thinking about using mvvmcross in one of the projects. So far I am just studying mvvmcross and browsing through different articles, but I can not find anything related to mvvmcross and the android service. How to start, stop, or bind to a service as a model. What is the โ€œbestโ€ approach when working with services? Does anyone have a link or something in this matter.

Uros

+4
source share
1 answer

In general, I consider Android services, long-term ios tasks and Windows background tasks as separate โ€œservicesโ€, and they usually do not interact directly with ViewModels, but instead interact through messaging, through data warehouses, etc. In particular, for Android, you may need to use review / activity level hooks, such as local service binding (see Android - interaction of services and actions )

When background services share the same process (same memory space) as ViewModels, then one thing that might seem a little awkward is initializing common IoCs and any necessary application singlets. However, as a rule, this does not seem to be too difficult to do - for example, see issues such as Using MvvmCross from content and action providers and Initializing MvvmCross

I personally have not seen enough examples of this type of application for development, if there are several common architectural patterns that can be represented at the level of the mvvm platform. I would like to see more examples and more people talking about architectural ideas in this area.

+4
source

Source: https://habr.com/ru/post/1491322/


All Articles