Android 之工具aidl
2013-05-10 08:43
260 查看
AIDL服务支持的数据类型如下:
Java的简单类型(int、char、boolean等)。不需要导入(import)。
String和CharSequence。不需要导入(import)。
List和Map。但要注意,List和Map对象的元素类型必须是AIDL服务支持的数据类型。不需要导入(import)。
AIDL自动生成的接口。需要导入(import)。
实现android.os.Parcelable接口的类。需要导入(import)。
aidl OPTIONS INPUT [OUTPUT]
OPTIONS:
-I<DIR> import类的查找路径
-d<FILE> 生成需要import的依赖类列表文件
-p<FILE> 指定需要import的类的预处理文件,可以同时指定系统自带的预处理文件framework.aidl和自定义的预处理文件preprocess.aidl
-o<FOLDER> 指定文件输出的目录
-b fail when trying to compile a parcelable.
在编译aidl文件时经常遇到couldn't find import for class ... 表示需要import相关的类,在sdk中有一个framework.aidl文件是系统自带的预处理文件,对于需要导入Parcelable接口的类,
通过引入framework.aidl文件即可解决couldn't find import for class ...问题,对于其他自定义的类,则需要先生成依赖类的预处理文件,通过以下命令生成:
aidl --preprocess /path/preprocess.aidl 1.aidl 2.aidl ....
比如说在编译3.aidl文件时,提示:
couldn't find import for class 1
couldn't find import for class 2
则使用命令:
aidl --preprocess ./preprocess.aidl 1.aidl 2.aidl
编译3.aidl文件:
aidl -I/path/to/project/src -p/path/to/framework.aidl -p./preprocess.aidl 3.aidl
Java的简单类型(int、char、boolean等)。不需要导入(import)。
String和CharSequence。不需要导入(import)。
List和Map。但要注意,List和Map对象的元素类型必须是AIDL服务支持的数据类型。不需要导入(import)。
AIDL自动生成的接口。需要导入(import)。
实现android.os.Parcelable接口的类。需要导入(import)。
aidl OPTIONS INPUT [OUTPUT]
OPTIONS:
-I<DIR> import类的查找路径
-d<FILE> 生成需要import的依赖类列表文件
-p<FILE> 指定需要import的类的预处理文件,可以同时指定系统自带的预处理文件framework.aidl和自定义的预处理文件preprocess.aidl
-o<FOLDER> 指定文件输出的目录
-b fail when trying to compile a parcelable.
在编译aidl文件时经常遇到couldn't find import for class ... 表示需要import相关的类,在sdk中有一个framework.aidl文件是系统自带的预处理文件,对于需要导入Parcelable接口的类,
通过引入framework.aidl文件即可解决couldn't find import for class ...问题,对于其他自定义的类,则需要先生成依赖类的预处理文件,通过以下命令生成:
aidl --preprocess /path/preprocess.aidl 1.aidl 2.aidl ....
比如说在编译3.aidl文件时,提示:
couldn't find import for class 1
couldn't find import for class 2
则使用命令:
aidl --preprocess ./preprocess.aidl 1.aidl 2.aidl
编译3.aidl文件:
aidl -I/path/to/project/src -p/path/to/framework.aidl -p./preprocess.aidl 3.aidl
相关文章推荐
- Android开发工具之Android Studio--调用系统隐藏方法之操作aidl文件步骤
- Android 之工具aidl
- Android aidl 工具及远程调用 (一)
- Android开发_aidl工具
- 闹钟实例与远程机制AIDL工具android:process=":remote"结合应用
- 闹钟实例与远程机制AIDL工具android:process=":remote"结合应用
- 【Android开发经验】超好用的json解析工具——Gson项目使用详解
- android sdk Manger 工具介绍
- 一、Android性能优化(渲染机制、内存与GC、电量优化)带工具找问题
- android mvp快速开发框架介绍(dileber使用之小工具使用)
- 非常有用的开发工具之Android Studio插件
- Android机顶盒开发工具小结
- 【学习第一章】关于ANDROID的工具Monkey的使用
- Android AIDL使用详解
- Androidx学习笔记(69)--- AIDL
- 【Android游戏开发十一】手把手让你爱上Android sdk自带“9妹”(9patch 工具),让Android游戏开发更方便!
- 【Android】开发优化之——调优工具:dump hprof file 查看内存情况,找到内存泄露
- Android 开发小工具之:Custom Tabs
- 【转】android调试工具monkey压力测试实战
- 菜鸟学Android(一): 开发工具的简介