Android hidl入门

项目需要:上层apk要调用vendor层的播放框架接口,而vendor层的接口需要利用hidl机制重新封装才能被apk调用。这里的新技能hidl入门的记录

工作习惯:先看官文,如下:

1)hidl简介 https://source.android.google.cn/devices/architecture/hidl

2)HIDL C++ https://source.android.google.cn/devices/architecture/hidl-cpp

3)HIDL Java https://source.android.google.cn/devices/architecture/hidl-java

AOSP系统自带的例子参考:https://source.android.google.cn/reference/hidl 链接中的源码需要翻墙才能查看,也可以直接查看自己项目中的Android源码找到对应hidl接口的代码。

似懂非懂的浏览完这些文档,开始coding还是要站在前人的肩膀上>_< 比较详细的示例:https://blog.csdn.net/sinat_18179367/article/details/95940030?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

第一次写hidl,是实现HIDL C++还是要实现HIDL Java,hidl service一般都是需要C++实现的,hidl client具体看上层是从Native调用还是从Java调用hidl接口。如果从Native调用hidl就要写C++ 的hidl client.详细的规则介绍还是要查看官网发布的内容。

猜你喜欢

转载自blog.csdn.net/sinat_37343534/article/details/112009686
今日推荐