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-serialport-api and libusb for android的更多相关文章

  1. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK assets/com.xx.xx

    完整的Error 信息(关键部分) Error:Execution failed for task ':fanwe_o2o_47_mgxz_dingzhi:transformResourcesWith ...

  2. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.Exec

    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.tr ...

  3. react native报错处理com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process

    背景:最近准备在使用react-native开发的app中接入友盟,来进行用户行为统计,分享,授权登录等操作. 在使用的过程中,遇到了一些错误信息,在此记录一下. 在修改android目录下的buil ...

  4. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files

    http://stackoverflow.com/questions/33951853/com-android-build-api-transform-transformexception-com-a ...

  5. Sorry, but the Android VPN API doesn’t currently allow TAP-based tunnels.

    Sorry, but the Android VPN API doesn’t currently allow TAP-based tunnels. Edit .ovpn configfile “dev ...

  6. Android 系统API实现数据库的增删改查和SQLite3工具的使用

    在<Android SQL语句实现数据库的增删改查>中介绍了使用sql语句来实现数据库的增删改查操作,本文介绍Android 系统API实现数据库的增删改查和SQLite3工具的使用. 系 ...

  7. Android 如何在Eclipse中查看Android API源码 及 support包源码

    当我们阅读android API开发文档时候,上面的每个类,以及类的各个方法都是已经写好的方法和控件,可是我们只是在搬来使用,不知道它的原理,它是如何被实现的.android系统是开源的,所以谷歌官方 ...

  8. 【NFC】Android NFC API Reference中英文

    0 Near Field Communication Near Field Communication (NFC) is a set of   short-range wireless technol ...

  9. Android开发-API指南-Fragment

    Fragments 英文原文:http://developer.android.com/guide/components/fragments.html 采集日期:2014-12-31 在本文中 设计理 ...

随机推荐

  1. secureCRT中文字符乱码

    1.远程linux机器.修改环境变量LANG.例如在~/.bash_profile里面添加 export LANG=zh_CN.UTF8 2.本地windows机器.修改SecureCRT的设置.找到 ...

  2. poj 2888 Magic Bracelet

    经典的有限制条件的Burnside计数+矩阵乘法!!! 对于这种限制条件的情况我们可以通过矩阵连乘得到,先初始化矩阵array[i][j]为1.如果颜色a和颜色b不能涂在相邻的珠子, 那么array[ ...

  3. linux网络环境配置

    第一种方法: (red hat) (1)用root身份登录,运行setup命令进入到text mode setup utility 对网络进行配置,这里可以进行ip,子网掩码,默认网关,dns的设置. ...

  4. Zookeeper + Hadoop + Hbase部署备忘

    网上类似的文章很多,本文只是记录下来备忘.本文分四大步骤: 准备工作.安装zookeeper.安装hadoop.安装hbase,下面分别详细介绍: 一 准备工作 1. 下载 zookeeper.had ...

  5. Linux系统下如何配置SSH?如何开启SSH?

    SSH作为Linux远程连接重要的方式,如何配置安装linux系统的SSH服务,如何开启SSH?下面来看看吧(本例为centos系统演示如何开启SSH服务). 查询\安装SSH服务 1.登陆linux ...

  6. HeadFirst设计模式之模板方法模式

    一. 1.The Template Method defines the steps of an algorithm and allows subclasses to provide the impl ...

  7. 126. Word Ladder II

    题目: Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transfo ...

  8. Spring RestTemplate介绍

    http://www.cnblogs.com/rollenholt/p/3894117.html RestTemplate 这篇文章打算介绍一下Spring的RestTemplate.我这边以前设计到 ...

  9. 功能齐全、效率一流的免费开源数据库导入导出工具(c#开发,支持SQL server、SQLite、ACCESS三种数据库),每月借此处理数据5G以上

    软件名:DataPie 功能:支持SQL server.SQLite.ACCESS数据库的导入.导出.存储过程调用,支持EXCEL2007.EXCEL2003.ACCESS2007. CSV文件导入数 ...

  10. 【HDOJ】1979 Fill the blanks

    预处理+搜索剪枝.4*4的边界上的数字必须是奇数. /* 1979 */ #include <iostream> #include <sstream> #include < ...