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 在本文中 设计理 ...
随机推荐
- 嵌入式开发之NorFlash 和NandFlash
http://blog.csdn.net/tigerjibo/article/details/9322035 [摘要]:作为一个嵌入式工程师,要对NorFlash 和NandFlash要有最起码的认知 ...
- 在服务器端使用 Git 创建源代码仓库
下面简单讲述在服务器搭建 Git 仓库的过程. 安装 Git 程序 Git 是分布式的,即程序不区分服务端和客户端,大部分 Linux 发行版的官方源里都有它,比如在 Archlinux 里安装 Gi ...
- C#+SQL数据库备份和还原
使用前要导入SQLDMO.dll(在com组件中导入Microsoft SQLDMO Object Library即可) /// /// DbOper类,主要应用SQLDMO实现对Microsoft ...
- 捕获Java线程池执行任务抛出的异常
捕获Java线程池执行任务抛出的异常Java中线程执行的任务接口java.lang.Runnable 要求不抛出Checked异常, public interface Runnable { publi ...
- JMS消息传输机制
JMS消息传送模型: 消息传送机制, 是基于拉取(pull)或者轮询(polling)的方式. JMS具备两种"消息传送模型": P2P和Pub/sub. (1) P2P:点对点 ...
- WinAPI——钩子函数大全3
函数原形:LRESULT CALLBACK JournalPlaybackProc(int code, WPARAM wParam, LPARAM lParam); 参数: code:指示一个代码,被 ...
- WinCE设置多国语言支持
最近项目中需要支持中(简繁)日韩英多种语言,在网上找了很多解决办法,最后发现还是MSDN最好. [c-sharp] view plaincopy [HKEY_LOCAL_MACHINE/SYSTEM/ ...
- CodeWars题目筛选
http://www.codewars.com/kata/search/csharp?q=&r%5B%5D=-8&xids=completed&beta=false 语言选择C ...
- java.lang.ClassNotFoundException: javax.persistence.EntityListeners
Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/EntityListene ...
- MySQL timed_mutexes
提要: MySQL 5.5.39 Release版本正式从源码里删除了全局参数timed_mutexes.timed_mutexes原本用来控制是否对Innodb引擎的mutex wait进行 计时统 ...