I tried again and again to put on a remote service by means of an AIDL interface and I need some help.
On the one hand, I have a project in which I specified the AIDL interface in a myFile.aidl file that generated an myFile.java. In addition, I implemented a Service in which a implement the method of the interface.
- Code: Select all
private final IAdditionService.Stub myBinder=new IAdditionService.Stub()
//Implementation of the add() method
public int add(int value1, int value2) throws RemoteException
Log.d(TAG, String.format("AdditionService.add(%d, %d)",value1, value2));
return value1 + value2;
All of these files (.aidl and his generated java file, and the service) are inside a package called com.package1
Now, I want to use this service in another project. So, I have an activity in a package called com.package2.
In this activity, I want to do a bindService or an startService for example, and the question is:
What I need to include in this second project?
I need import the package1?
I need to create a package called also com.package1 and to put inside a java interface?
I need to create a package called also com.package1 and to put inside the aidl file?
Maybe some extra information in the manifest?
I've read several links but I don't found the solution and I'm so saturaded at this moment? Some advice?
A lot of thanks,