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)?>
1.when to use aidl based service.
A few benefits can be gained by segment part of your code into backend service:
2.how to create such a service
I have written a good library, you can refer as an example http://github.com/zhchang/hogwarts