下了一个开源项目——AutoAnswer,想学习一下自动应答的实现方式,但是编译时发现里面的一个aidl文件报couldn't find import for class错误。是 import android.bluetooth.BluetoothDevice 时报的错。觉得很奇怪,既然这是正式发布的开源项目的东西,开发者自己编译应该是没问题的,为什么我编译就报错呢? 难道真要像网上的一些说法,还要另外修改mk文件才能编译么?文件内容如下:package android.bluetooth;import android.bluetooth.BluetoothDevice;/**
* System private API for Bluetooth Headset service
*
* {@hide}
*/
interface IBluetoothHeadset {
int getState();
BluetoothDevice getCurrentHeadset();
boolean connectHeadset(in BluetoothDevice device);
void disconnectHeadset();
boolean isConnected(in BluetoothDevice device);
boolean startVoiceRecognition();
boolean stopVoiceRecognition();
boolean setPriority(in BluetoothDevice device, int priority);
int getPriority(in BluetoothDevice device);
int getBatteryUsageHint();
}
* System private API for Bluetooth Headset service
*
* {@hide}
*/
interface IBluetoothHeadset {
int getState();
BluetoothDevice getCurrentHeadset();
boolean connectHeadset(in BluetoothDevice device);
void disconnectHeadset();
boolean isConnected(in BluetoothDevice device);
boolean startVoiceRecognition();
boolean stopVoiceRecognition();
boolean setPriority(in BluetoothDevice device, int priority);
int getPriority(in BluetoothDevice device);
int getBatteryUsageHint();
}
解决方案 »
- 如何在android4.0中开启GPS
- 在窗体上放了一个WebView显示某个网页,为什么真机上会调用浏览器打开?
- android message
- Android中ListView按上下键滚屏不刷新,求指教
- 如何用canvas在自定义view里画图
- android在锁屏状态下能监控电源键并触发事件(程序)吗?
- 各类资源0分下载---第三期
- Andoid GPS 如何进入省电模式 M
- 使用ant编译android工程遇到的问题
- 请教:library中的viewpager滑动,让导入它的项目中保持一样的显示?
- 小菜请教高手:在android中怎么用代码将麦克风的音量设为静音
- 面试Android会问道些什么知识点
比如放在android.bluetooth包下面package android.bluetooth.BluetoothDevice;
Parcelable BluetoothDevice;