Home  >  Q&A  >  body text

android中mvc架构问题

目前项目分层为:app,core,api,model。分层设计参考:链接。作者说把逻辑处理的都放到core层里。那BroadCastReceiver和Service应该放到什么地方呢?这两个都有逻辑处理,如果放到core层里,不利于解绑和绑定。

阿神阿神2727 days ago675

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-17 15:19:58

    Put BroadCastReceiver wherever it is needed. If people want it, you won’t give it to them?
    Service must be the core.
    Why do you need to unbind and bind to Service?
    Service runs its own. Other modules can send messages to it and listen to its broadcasts. What to do to bind and unbind?

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:19:58

    Create a package called service. . Put it inside. That’s it.

    reply
    0
  • Cancelreply