Android驱动开发的一些问题
我对这个领域很陌生。事实上我才刚刚开始研究可能性。
我的问题的简单版本是,开发一个驱动程序(例如 USB<->串行)、将其部署到 Android 手机(商业产品,而不是定制产品)并编写应用程序来利用它需要什么?这可能吗?
这里有一个更长的版本。
我已经有Windows驱动程序开发的经验和一些Linux驱动程序的知识。我也做了一些研究。我只知道NDK。我不知道的是:
我发现的所有参考似乎都暗示驱动程序开发是在设计设备时完成的,而不是为了破解现有的设备。是这样吗?
如果可以的话如何部署?驱动是不是要和内核集成到ROM里刷?
如果设备不支持 USB 主机,是因为硬件设计还是只是软件中缺少某些内容,还是两者兼而有之?
抱歉问题清单很长。关于这个领域的任何建议都会有所帮助,因为我还有其他计划涉及从头开始构建 Android 设备。感谢您抽出时间。
顺便说一句,ADK 对于我的应用程序来说太昂贵了(至少现在),所以它不在考虑范围之内。
I am very new to this field. Actually I just begin to investigate the possibilities.
The simple version of my question is, what will it take to develop a driver (say USB<->Serial), deploy it to an Android phone (commercial product, not customized one) and write apps to utilize it? Is this even possible?
And here comes a longer version.
I already have experiences on Windows driver development and some knowledge of Linux driver. And I also did some research. All I know about is NDK. What I don't know is:
All reference I found seems to imply driver developing is done when designing the device, not for hacking an exist one. Is that the case?
How to deploy if possible? Does the driver has to be integrated with the kernel into a ROM and brush?
If the device does not support USB host, is it because the hardware design or just something missing in the software or both?
Sorry for the long question list. Any suggestions regarding this field will help since I have other plans involving building an Android device from scratch. Thanks for your time.
And by the way, ADK is too expensive (at least now) for my application so it's out of the equation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Honeycomb 可能为 USB 主机和使用它的一些功能提供标准化支持,并且许多 Honeycomb 设备似乎都有该端口,但我不知道 Honeycomb 中是否有一个标准表明它应该附带可用的 USB<> 串行驱动程序在上游 Linux 内核中。
对于所有早期版本,任何可能性都将是特定于设备的并且需要 root 访问权限。
ADK 可用于最新的 Android 版本,但正如您所指出的,这是一个非常次优的解决方案,因为它将所有复杂性都放在了配件中,并且还需要提供总线电源,这两者都与通常情况“相反”。
Honeycomb may provide standardized support for USB host and some functions using it, and many honeycomb devices seem to have the port, but I don't know if there's a standard in honeycomb that says it should ship with the USB<>serial drivers available in the upstream linux kernel.
For all earlier versions, any possibility is going to be device specific and require root access.
ADK is available for the latest Android versions, but as you noted it's a very suboptimal solution, in that it puts all the complexity in the accessory and also requires that to provide bus power, both of which are "backwards" from the usual case.
1., 2. 您无法将自定义驱动程序注入未root的库存ROM中。要注入驱动程序,您的用户需要 root 设备或完全刷新自定义 ROM。
3.- 这取决于设备。有些可以用定制软件做USB主机,有些则不能。
查看 Android 开放配件开发套件。有了这个,您可以构建一个带有串行端口的板,通过 Android 配件协议与普通 Android 2.3.4+ 和 Android 3.1+ 设备进行通信。
1., 2. You cannot inject custom driver in unrooted stock ROM. To inject a driver, your users will need to root the device or flash a custom ROM altogether.
3.- It depends on device. Some can do USB host with custom software, some can't.
Check out the Android Open Accessory Development Kit. With this you could build a board with serial port that talks with stock Android 2.3.4+ and Android 3.1+ devices via Android accessory protocol.
安装驱动程序需要 root。
举个例子:
http://groups.google.com/group/android -platform/browse_thread/thread/e1794bdecebb62cc?pli=1
To install a driver will require root.
For an example:
http://groups.google.com/group/android-platform/browse_thread/thread/e1794bdecebb62cc?pli=1