What is AIDL?
来源:互联网 发布:知更 杨千嬅试听 编辑:程序博客网 时间:2024/06/02 06:06
AIDL我们只知道是用来IPC进程间通信的,但是何时才用到它呢,下面是Android的官方建议!
Note: Using AIDL is necessary only if you allow clients from different applications to access your service for IPC and want to handle multithreading in your service. If you do not need to perform concurrent IPC across different applications, you should create your interface by implementing a Binder or, if you want to perform IPC, but do not need to handle multithreading, implement your interface using a Messenger. Regardless, be sure that you understand Bound Services before implementing an AIDL.
Calls made from the local process are executed in the same thread that is making the call. If this is your main UI thread, that thread continues to execute in the AIDL interface. If it is another thread, that is the one that executes your code in the service. Thus, if only local threads are accessing the service, you can completely control which threads are executing in it (but if that is the case, then you shouldn’t be using AIDL at all, but should instead create the interface by implementing a Binder).
Calls from a remote process are dispatched from a thread pool the platform maintains inside of your own process. You must be prepared for incoming calls from unknown threads, with multiple calls happening at the same time. In other words, an implementation of an AIDL interface must be completely thread-safe.
The oneway keyword modifies the behavior of remote calls. When used, a remote call does not block; it simply sends the transaction data and immediately returns. The implementation of the interface eventually receives this as a regular call from the Binder thread pool as a normal remote call. If oneway is used with a local call, there is no impact and the call is still synchronous.
- What is AIDL?
- What is what ?!
- what is what?
- What is portal? & What is portlet?
- what is game? what is good game?
- What Is 'SSL'? What Is 'SSH'?
- aidl is missing
- WHAT IS C#
- What is System Administration?
- What is EDI?
- What Is Wiki
- What is Struts Resume?
- what is blog??
- What is AspectJ
- what is grid ?
- What is MSN Messenger
- What is Plone?
- What is Mono?™
- spring property标签中的 ref属性和ref 标签有什么不同? 如下:<property name="a" ref="b" />
- Depends: libmpg123-0:i386 but it is not installable Recomm
- tomcat国际化
- Linux sed命令实例详解
- HDFS报错:Connection refused!
- What is AIDL?
- 动画学习 五
- 配置nginx使得主域名301重定向到www子域名
- [lintcode] - 426 Restore IP Addresses
- jQuery -- label赋值
- 亚马逊AWS的基础设施规模究竟有多大?
- 软件开发管理: 签入测试
- 技术笔记 - 初识Maven
- [Computer and Network Security] Gaining Access using Network Attacks