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. Kafka 之 async producer (1)

    问题 很多条消息是怎么打包在一起的? 如果消息是发给很多不同的topic的, async producer如何在按batch发送的同时区分topic的 它是如何用key来做partition的? 是如 ...

  2. python time相关操作

    1.获取当前时间的两种方法: 代码如下: import datetime,timenow = time.strftime("%Y-%m-%d %H:%M:%S")print now ...

  3. Tornado,表单处理,一样在行

    哟,处理流程还算自然... import os.path import random import tornado.httpserver import tornado.ioloop import to ...

  4. linux 修改命令行编码 乱码解决方案

    修改/etc/default/locale命令:sudo vim /etc/default/locale1将下面这两行 LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh 修改为: ...

  5. codeforces #305 div1 done

    总算搞定了这一场比赛的题目,感觉收获蛮大 其中A,B,C都能通过自己的思考解决掉 D题思路好神,E题仔细想想也能想出来 以后坚持每两天或者一天做一场CF的div1的全套题目 除非有实在无法做出来的题目 ...

  6. xcode 预编译头文件

    xcode 预编译头文件 cocos2d-prefix.pch  #import <Foundation/Foundation.h>

  7. FPGA中latency与delay概念的区别

    2013-06-17 21:09:26 最近学习流水线以及状态机,总遇到注入加入寄存器可以分割组合逻辑,从而提高电路的运行频率的说法:还有流水线可以提高速度的说法,刚开始很是疑惑,觉得流水线的方法,输 ...

  8. Microsoft.Data.ConnectionUI.DataConnectionDialog

    MicrosoftVisualStudio里面的资源之数据库连接配置 这个功能的实现主要是用了Microsoft.Data.ConnectionUI.dll和Microsoft.Data.Connec ...

  9. 函数buf_LRU_get_free_only

    /******************************************************************//** Returns a free block from th ...

  10. Mongodb的范式化和反范式化

    如果是涉及到一对多的数据格式,可使用文档引用范式化数据. 在一个,User对象中,如果涉及到工作信息或者联系地址的,这些信息会频繁的进行访问,可使用嵌入式文档对数据进行反范式化.