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.

  • 相关阅读:
    Android Touch事件相关源码【Android SourceCode 2.3.6】
    使用方式比较优雅的代码集合
    Android系统中是否开启定位及定位模式的判断
    Android中软键盘展示、EditText焦点获取及windowSoftInputMode属性探究
    删除rz上传失败乱码的文件
    linux mysql 操作命令
    linux下端口被占用
    linux环境搭建记录
    ibatis 批量插入数据
    jQuery id模糊 选择器 批量处理
  • 原文地址:https://www.cnblogs.com/welhzh/p/5009804.html
Copyright © 2011-2022 走看看