在Android平板电脑上浏览USB设备中的文件
我正在为具有 USB 端口的 Android 平板电脑开发一个项目。在这个项目中,当 USB 设备插入选项卡时,我需要浏览 USB 设备中存在的文件。
有谁知道这一点吗?有关于这个主题的教程吗?有没有示例代码。
目前我使用的是 Android 2.2,根据 Android 文档,它说仅在 Android 3.1 及更高版本中支持 USB 主机模式.我需要将 API 级别更改为 Android 3.1
请帮忙...:(
I am developing a project for an Android tablet which has USB port.In this project,i need to browse the files present in the USB device when a USB device is plugged into the tab.
Does any one know about this,And is there any tutorial regarding this topic ?.Is there any sample code..
Currently I am using Android 2.2 , As per the Android docs it says that USB host mode is supported only in Android 3.1 and above.Do i need to change my API level to Android 3.1
Please help...:(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从Android开发者网站上提供的文档来看,USB API似乎是从Android 3.1(API级别12)开始提供的。 Android 2.2 不提供USB API。
如果您还有 Android 2.3.4 设备,那么您可以使用“开放附件库”,它基于平台内置的 USB(通用串行总线)堆栈和向应用程序公开的 API。查看下面的链接了解更多信息:
2.3.4 的开放配件库
From the documentation provided on Android Developer site, it seems that USB APIs are provided from Android 3.1 (API level 12) onwards. Android 2.2 doesn't offer USB APIs.
In case you also have Android 2.3.4 device, then you can use 'Open Accessory Library' which is based on a USB (Universal Serial Bus) stack built into the platform and an API exposed to applications. Check out the link below for more information:
Open Accessory Library for 2.3.4