I have built two project. One is activity, one is service.
There are a few things to note when you are doing two project communications:
1. In activity project, introduce the Aidl file in service project. Note the introduction of the Aidl file package name should be consistent with the Aidl file package name in the service.
2.service project in manifest file, service registration to declare android:process= ": Remote"
The action should be the package name of the interface in the Aidl. Interface name.
3.activity Bindservice A Serviceconnection object corresponds to a service, otherwise it will be reported java.lang.SecurityException:Binder invocation to an Incorrect interface exception.
Additions to the 1th
For example, you originally established a com.abc.service.test.aidl in the service
So you have to create a com.abc.service.test.adil in the Activity that you want to communicate. Do not put Test.adil directly in your activity package, re-see a package, the package name is Com.abc.service and then put the test.aidl into the finished
Aidl causes an abnormal cause Android java.lang.SecurityException:Binder invocation to an incorrect interface