AIDL service纪事 注意事项
来源:互联网 发布:java酒店需求分析 编辑:程序博客网 时间:2024/05/01 10:26
本人学习AIDL实现过程遇到的几个问题记录:
1.
aidl文件的描述中的package ,服务端代码的路径(如 package com.allan.hs.services;)是包名;而本地(服务端代码)实现它的service中, <service
android:name="com.allan.hs.services.AHWKeysService"
android:exported="true"
android:process=":remote" >
<intent-filter>
<action android:name="com.allan.hs.services.IAIDLService" />
</intent-filter>
</service>
注意两点,<action android:name="XXXX" /> 请从gen目录确认名字。
2.
Service Intent must be explitict.
5.0 api 在客户端代码调用intent有差异。注意第一个包名是路径,第二是app包名。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.allan.hearthstoneanalysis"
android:versionCode="1"
android:versionName="1.0" ><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.allan.hsa"
android:versionCode="1"
android:versionName="1.0" >
Intent it = new Intent("com.allan.hs.services.IAIDLService").setPackage("com.allan.hsa");
bindService(it, mRemoteConnection,
Context.BIND_AUTO_CREATE);
3. SecurityException: Binder invocation to an incorrect interface
需要确保客户端中,aidl 也放在com.allan.hs.services这个路径下。
4. 服务对象NULLpointerException,或者onServiceConnected()没有被调用
请确认服务端是否onBind()中return了。
不自己写永远不知道有这么多问题。mark一下。
- AIDL service纪事 注意事项
- AIDL注意事项
- 纪事
- Service AIDL
- service aidl
- service、aidl
- AIDL Service
- Service--AIDL
- Service, AIDL
- Android 使用aidl注意事项
- AIDL通讯注意事项
- aidl使用和注意事项
- AIDL使用的注意事项
- AIDL开发注意事项
- service注意事项
- 通过AIDL调用Service
- aidl service example
- 通过AIDL调用Service
- 【js】selector值改变时显示当前选中option值
- 把数组排成最小的数
- hdu 2089 不要62(数位dp)
- [040130]命运之夜Fate Stay Night【汉化硬盘版】[带全通关CG回想完美&跳过序章初始存档&中文攻略]
- java列出指定后缀名(*.jpg)的图片
- AIDL service纪事 注意事项
- iOS 8 Auto Layout界面自动布局系列3-使用代码添加布局约束
- 小紫书 4-5 UVA 1590 IP Networks
- Linux驱动第一课--helloworld
- iOS小明开发笔记(四) (AVFoundation简介)
- spring配置文件中声明式事务和OpenSessionInViewFilter深入研究和汇总
- //logoImageView高度为父视图高度一半
- #HDU 1312 Red and Black 【DFS入门】
- 双指针法的常见应用