android的USB开发时 mUsbManager.getDeviceList()获取都为空
2013-09-03 23:09
316 查看
解决方法
http://stackoverflow.com/questions/11183792/android-usb-host-and-hidden-devices
创建
android.hardware.usb.host.xml
里面内容为:
用下面命令添加到android中
adb push android.hardware.usb.host.xml /system/etc/permissions
再使用下面命令:
adb pull /system/etc/permissions/tablet_core_hardware.xml
打开更新下来的文件,添加一行配置:
再使用命令:
adb push tablet_core_hardware.xml /system/etc/permissions
重启系统即可:
adb reboot
注意:
如果是手机的话tablet_core_hardware.xml的名字替换成
handheld_core_hardware.xml
之前做过好多单片机与android通过otg口做通信都失败了可能都是这个原因
已经采用arduino,ft232r 测试成功,相信之前买的 arduino usb shield 也同样能够测试成功,这样可以用机顶盒代替昂贵的开发板了
不过不想外接设备,也可以买 cubieboard 之类的开发板,那种开发板真的是性价比超级高,且相关资源也很丰富
http://stackoverflow.com/questions/11183792/android-usb-host-and-hidden-devices
创建
android.hardware.usb.host.xml
里面内容为:
<permissions> <feature name="android.hardware.usb.host"/> </permissions>
用下面命令添加到android中
adb push android.hardware.usb.host.xml /system/etc/permissions
再使用下面命令:
adb pull /system/etc/permissions/tablet_core_hardware.xml
打开更新下来的文件,添加一行配置:
<feature name="android.hardware.usb.host"/>
再使用命令:
adb push tablet_core_hardware.xml /system/etc/permissions
重启系统即可:
adb reboot
注意:
如果是手机的话tablet_core_hardware.xml的名字替换成
handheld_core_hardware.xml
之前做过好多单片机与android通过otg口做通信都失败了可能都是这个原因
已经采用arduino,ft232r 测试成功,相信之前买的 arduino usb shield 也同样能够测试成功,这样可以用机顶盒代替昂贵的开发板了
不过不想外接设备,也可以买 cubieboard 之类的开发板,那种开发板真的是性价比超级高,且相关资源也很丰富
相关文章推荐
- Android USB Host开发之manager.getDeviceList()获取不到设备列表
- Android USB Host开发之manager.getDeviceList()获取不到设备列表
- Android USB Host开发之manager.getDeviceList()获取不到设备列表【转载】
- Android USB Host开发之manager.getDeviceList()获取不到设备列表
- Android开发之获取系统管理权限,即DevicePolicyManager和DeviceAdminReceiver的使用
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- Android开发学习---如何写数据到外部存储设备(sd卡),Environment.getExternalStorageDirectory,怎么获取sd卡的大小?
- 如何获取Android项目的VersionName的getPackageManager()
- [android] 百度地图开发 (三).定位当前位置及getLastKnownLocation获取location总为空问题
- android google map 开发中的常见问题及解决(无法获取 google map apiKey 和Couldn't get connection factory client)
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- android开发:The method getSupportFragmentManager() is undefined for the type
- Android开发之ActivityManager获取系统信息
- 如何获取Android项目的VersionName的getPackageManager()
- Android开发平台中,可通过TelephonyManager 获取本机号码
- Android开发:用getDrawingCache方法获取ImageView中的图像需要注意的问题
- Android开发:用getDrawingCache方法获取ImageView中的图像需要注意的问题 本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http:/
- android L 变化之 ActivityManager.getRunningTasks不能获取当前的task列表
- CaptureDeviceManager.getDeviceList方法返回null对象问题探究