Reprint example schematic this article, in a simple case, records how to use Aidl to implement interprocess communication: First, create two projects, one project (Remoteservice) as the remote service provider, the other (remoteservicetest) As a client that invokes a remote service. Then, when the client binds the remote service, it can invoke the method in the remote service through the Aidl interface, the principle process remote Service Remoteservice Project
1. Create the Aidl file, select the package name that contains the service class you want to provide, right-click the file, Aidl. Aidl, New--
Here the Aidl file is named Remoteinterface, after creation, a Aidl folder is generated under Main, and a package name is the same as the package name just selected, and a remoteinterface.aidl is generated under the package.
2. Open the Remoteinterface.aidl file, define an interface method Remoteprintinterface (); To recompile the project, click Build-->make Project (you can also point directly to the arrow), and if successful, a Remoteinterface interface file will be generated in the following directory
Note Do not modify this interface file, the interface has an important stub class, is to be used later, the stub class inherits the binder, and implements the Remoteinterface interface.
Ii. Creating engineering Application projects using remote services Useremotedemo Engineering:
1. Copy the Aidl folder in the main directory of the Remotedemo to the main directory of the Useremotedemo project;
Androidstudio enabling the binding of remote service via Aidl