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. 在ECLIPSE中用MAVEN和TOMCAT来建立WEBAPP

    找了很多示例,结合以下两个URL,比较简单的测试了一下. http://blog.csdn.net/clj198606061111/article/details/20221133 http://ww ...

  2. ASP.NET 全局变量和页面间传值方法

    http://www.cnblogs.com/dgjack/archive/2011/05/28/2060913.html 1. 使用QueryString变量 QueryString是一种非常简单的 ...

  3. [译]Atomic VS. Non-Atomic 操作

    原文链接:atomic-vs-non-atomic-operations 在网上已经写了很多关于原子操作的文章,但是通常都集中在原子的读-修改-写(RMW. read-modify-write)操作. ...

  4. WINCE6.0远程桌面显示修改

    备注:用RDP表示远程桌面 WINCE6.0自带的远程桌面在我们显示屏分辨率为240*320上有一部分内容无法显示出来,所以就需要调整界面让这些内容可见. 1.      PB6.0不支持对远程桌面资 ...

  5. git svn rebase出现了checksum mismatch的错误

    http://stackoverflow.com/questions/3156744/git-svn-rebase-checksum-mismatch This solution was the on ...

  6. C语言一维数组中的数据随机排列

    #include <stdio.h>#include <stdlib.h> void randomlize(int *a, int n){        int i = 0,j ...

  7. js压缩、混淆和加密

    最近看到有些论坛在讨论js压缩.混淆和加密的问题,特意找了些资料看了下,现在总结一下: 1.关于三者的定义与区别 压缩:删除 Javascript 代码中所有注释.跳格符号.换行符号及无用的空格,从而 ...

  8. 结构体buf_chunk_t

    /** Buffer pool chunk comprising buf_block_t */ typedef struct buf_chunk_struct buf_chunk_t; /** A c ...

  9. bzoj3196

    平衡树系列终于完结,撒花 裸的树套树,扔代码跑 ; ..] of longint; son:..,..] of longint; a,root:..*] of longint; i,n,m,x,y,k ...

  10. 获取QQ所有的表情包,包括emoji,动态gif

    获取QQ所有的表情包,包括emoji,动态gif,代码如下. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xht ...