当前位置:网站首页>进程间通信-----aidl
进程间通信-----aidl
2022-06-21 04:53:00 【咋就那么爱学习】
Android Interface Definition Language
“AIDL是一个缩写,全称是Android Interface Definition Language,也就是Android接口定义语言。
一:aidl 的简单使用
服务端:
1.创建aidl的文件,比如创建 IStudent.aidl 文件


2. 在IStudent.aidl 文件中,新增自己的方法/需求

3. 通过Android studio 的 Build---->Rebuild Project, 会把 IStudent.aidl 文件 生成相应的IStudent.java 文件
在IStudent.java 文件中,会生成一个静态的抽象类Stub,如下:

该Stub类继承了android.os.Binder,同时实现了com.e.aidlservice.IStudent。所以Stub类具有 Binder 的功能,又有IStudent 的能力,后面我们只需要继承Stub 类。
manifest:

Service:

客户端:

怎么连接服务端的?



整体流程:


执行结果:


边栏推荐
- Kprobe User Guide
- Time series database Apache iotdb unit vs. multivariate time series write and query performance comparison - Tian Yuan
- Effective semi supervised learning for a small number of labeled samples using dp-ssl
- ESP32 SSL/TLS 双向认证实践
- 【UVM入门 ===> Episode_5 】~ TLM通信
- [test report] function test example template
- Unity2D--获得一张图片里的多种图片
- kubernetes code-generator使用
- Office, Excel, word, PPT operating skills personal notebook (continuously updated)
- SSM framework project - enterprise level CRM management system project (take you from building to project completion)
猜你喜欢

dotnet 使用 Crossgen2 对 DLL 进行 ReadyToRun 提升启动性能

Audio and video technology development weekly | 250

No programming required, generate crud restful API interface based on PostgreSQL zero code

时序数据库Apache IoTDB单元与多元时间序列写入与查询性能对比——田原

安鸾之基础题系列&暴力破解系列部分展示

unity srpbatcher

Recall, rough sorting and fine sorting in live broadcast recommendation

【CMake】CMake学习笔记

JMeter usage teaching

VMware disk expansion part presentation
随机推荐
【CMake】CMake学习笔记
Share an open source, free and powerful video player library
PMP和MBA哪个含金量高一点?
正态分布及其应用
Unity2D--获得一张图片里的多种图片
图像分割背景介绍
Digital learning - model building and evaluation
Redis delete policy
2022 Shandong vision prevention and control exhibition, eye care and health products exhibition, eye care instrument exhibition and light feeding Instrument Exhibition
怎么样学习pmp知识?
[database] the leftmost prefix principle for overwriting indexes
LeetCode-71
数分学习-模型建立和评估
Variable testing of multi version dynamic library
From one interview question to n interview questions
Search 2D matrix
How to learn PMP knowledge?
unity srpbatcher
ESP32 SSL/TLS 双向认证实践
GooseFS 在云端数据湖存储上的降本增效实践