开发者

Should Android services be completely independent of an application?

We currently have an application that starts its own background services to manage syncing of data and downloads of files/images. We want to automate some of 开发者_如何学Pythonthose services and we have a difference of opinion on what the best way forward is.

I contend that having services completely separate and driven through intents is a better way to go, but some team members are saying we should just leave it as it is and have alarms just signal to our app via intents. The problem is, some of these services may need to run even if the app is closed. I think a loosely coupled design is inherently better.

Just wondering what the general consensus is for Android services?


Loosely coupled is definitely better, I agree with you. Only use apps (and by this I mean Activities or UI's) to configure your service.

Services are daemons, should work like in any other OS (background tasks that run as soon as the OS is up and running without any user intervention, except as I mentioned, for configuration).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜