When to use an aidl based service?

前端 未结 4 815
萌比男神i
萌比男神i 2021-01-11 12:45

Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)?

4条回答
  •  无人及你
    2021-01-11 12:52

    1.when to use aidl based service.

    A few benefits can be gained by segment part of your code into backend service:

    • decouple front-end and back-end
    • memory/cpu intensive processing can be stacked to backend service, GC in service will not affect front-end user experience
    • service crash will not bring down the whole APP

    2.how to create such a service

    I have written a good library, you can refer as an example http://github.com/zhchang/hogwarts

提交回复
热议问题