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-serialport-api and libusb for android的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- Android 系统API实现数据库的增删改查和SQLite3工具的使用
在<Android SQL语句实现数据库的增删改查>中介绍了使用sql语句来实现数据库的增删改查操作,本文介绍Android 系统API实现数据库的增删改查和SQLite3工具的使用. 系 ...
- Android 如何在Eclipse中查看Android API源码 及 support包源码
当我们阅读android API开发文档时候,上面的每个类,以及类的各个方法都是已经写好的方法和控件,可是我们只是在搬来使用,不知道它的原理,它是如何被实现的.android系统是开源的,所以谷歌官方 ...
- 【NFC】Android NFC API Reference中英文
0 Near Field Communication Near Field Communication (NFC) is a set of short-range wireless technol ...
- Android开发-API指南-Fragment
Fragments 英文原文:http://developer.android.com/guide/components/fragments.html 采集日期:2014-12-31 在本文中 设计理 ...
随机推荐
- 1027-Quicksum
描述 A checksum is an algorithm that scans a packet of data and returns a single number. The idea is t ...
- highcharts 多数据+切换
var highchartsOptions = { chart:{ renderTo:'container' }, title:{ text:'指标数据' }, tooltip:{ pointForm ...
- [codility]Min-abs-sum
https://codility.com/demo/take-sample-test/delta2011/ 0-1背包问题的应用.我自己一开始没想出来.“首先对数组做处理,负数转换成对应正数,零去掉, ...
- jquery的ajax向后台servlet传递json类型的多维数组
后台运行结果: 前台运行结果: ...
- Linux防火墙iptables简明教程
前几天微魔部落再次遭受到个别别有用心的攻击者的攻击,顺便给自己充个电,复习了一下linux下常见的防火墙iptables的一些内容,但是无奈网上的很多教程都较为繁琐,本着简明化学习的目的,微魔为大家剔 ...
- 利用CCProxy管理小型企业的上网行为
本实验以实例方式,从操作条件.背景.需求.以及具体要求的几个部分进行说明. 1. 操作条件: 装有Windows Server 2003系统,安装了代理服务程序的虚拟机一台 2. 背景: 为了提高员工 ...
- P102、面试题14:调整数组顺序使奇数位于偶数前面
题目:输入一个整数数组,实现一个函数来调整该数组中数字的属性怒,使得所有奇数位于数组的前半部分,所有偶数位于数组的后半部分. 思路:其实就是用快速排序法的第一轮排序,从左右夹逼,左边遇到偶数,停下来, ...
- Git教程(3)命令行使用git简单示例
基础 Git系统下的的文件有3种状态: 已修改(modified):已修改表示修改了文件,但还没保存到数据库中. 已暂存(staged) : 已暂存表示对一个已修改文件的当前版本做了标记,使之包含在下 ...
- poj1026Cipher(置换群)
链接 找循环节 然后所有子循环节的最小公倍数就是总的循环节 找结果的时候也按一个个置换来进行转换 不然也TLE #include <iostream> #include<cstdio ...
- Java和.NET在开发中的不同盘点
我是用VS2008和VS2010开发.NET程序,通过MyEclipse8.5开发JAVA程序,下面从IDE.语言.插件的不同点来做下简单的说明.但由于经验知识还有限,本篇文章只能从比较表面的以及自己 ...