写一个aidl
aidl就会想到Binder机制,想到CS通信。
定义接口
ITest{
int saySomething(String content);
}
aidl原理
对于客户端,本身持有服务的代理,不会真正去实现,也就是客户端如果说话,不会自己做,而是持有的代理去做这件事
class Proxy implements ITest{
Binder mRemote;
public Proxy(IBinder mRemote){
this.mRemote=mRemote;
}
//传输数据
void transact(){
}
}
对于服务端
class Stub extends Binder implements ITest{
void onTransact()
}