zoukankan      html  css  js  c++  java
  • android-serialport-api and libusb for android

    libusb for android:

    Even if you get it compiled, Android is probably not going to let you access the USB device through libusb unless your device is rooted. If it is feasible to port your app to Android's native USB stack, that would almost certainly be a more stable solution.

    http://stackoverflow.com/questions/15957509/compile-and-link-against-libusb-for-android

    http://stackoverflow.com/questions/6163856/usb-device-attached-intent-not-firing/8328814#8328814

            Example:    <usb-device vendor-id="0BDA" product-id="8187"/>   IS  WRONG;           <usb-device vendor-id="3034" product-id="33159"/>   IS RIGHT!

    http://stackoverflow.com/questions/11638216/how-to-make-an-basic-android-usb-host-application

    libusb for android:   https://github.com/libusb/libusb/blob/master/android/README,       https://github.com/OpenNI/OpenNI2/tree/master/ThirdParty/PSCommon/XnLib/ThirdParty/libusb-1.0.9-Android 

    另外,有一个叫usb4java的开源项目,它包含有怎么使用的example,可以作为学习怎么使用libusb,地址如下:

    http://usb4java.org/index.html

    https://github.com/usb4java/

    https://github.com/usb4java/libusb4java

    https://github.com/usb4java/usb4java

    https://github.com/usb4java/usb4java-javax-examples

    https://github.com/usb4java/usb4java-examples

    android-serialport-api:

    https://code.google.com/p/android-serialport-api/

    https://github.com/cepr/android-serialport-api

    源码也可见我自己的云盘。

    The current Android SDK does not provide any API for reading and writing to the Linux TTY serial ports. You may find such serial ports on the connector of HTC Android phones.

    This project wants to provide a simple API to connect, read and write data through theses serial ports.

    The supported features are:

    • listing the available serial ports on the device, including USB to serial adapters
    • configuring a serial ports (baudrate, stop bits, permission, ...)
    • providing standard InputStream and OutputStream Java interfaces

    What is NOT possible with this project:

    • receiving/sending data through an USB slave interface

    Please have a look on the Wiki for more information. You may also find relevant information in users comments.

    An application sample is available for download in Downloads section, and also on Android Market.

  • 相关阅读:
    SharePoint自动化系列——Add content type to list.
    Java中通过Selenium WebDriver定位iframe中的元素
    Mac环境下用Java(Sikuli+Robot)实现页游自动化
    PowerShell处理RSS信息
    用Python脚本做一些网页游戏中力所能及的自动化任务
    利用Spire for .NET实现办公自动化——Spire.Doc
    两道关于数据处理方面的面试题
    用C#钩子写一个改键外挂
    C#实现中国天气网JSON接口测试
    C#实现中国天气网XML接口测试
  • 原文地址:https://www.cnblogs.com/welhzh/p/5009804.html
Copyright © 2011-2022 走看看