长文警告:从AIDL到内核,一次完整的Binder通信
AIDL生成代码分析
AIDL使用
首先写一个IHelloInterface.aidl文件如下
interface IHelloInterface {
void hello(String msg);
}
复制代码
build之后会生成 IHelloInterface.java文件,然后创建一个远程服务
class RemoteService : Service() {
private val serviceBinder = object : IHelloInterface.Stub() {
原创
2021-07-30 21:19:06 ·
499 阅读 ·
1 评论