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 在本文中 设计理 ...
随机推荐
- 关于jsp页面是放在webroot目录下和web-inf下优缺点
CSDN问题: jsp放在webroot目录下 这样就可以让用户直接访问,jsp放在web-inf目录下就必须要通过请求才能访问.因此放在web-inf下jsp页面显得要安全. 既然这样 ,那是不是只 ...
- CentOS7.1配置远程桌面
网上看了很多资料,完全是乱的. 我使用的是CentOS7.1的系统.我的要求是windows的客户机可以远程访问CentOS系统. 1,首先需要检查一下服务器是否已经安装了VNC服务,检查服务器的是否 ...
- Android安全问题 钓鱼程序
导读:文本介绍一种钓鱼应用,讲述如何骗取用户的用户名和密码,无须root 这个话题是继续android安全问题(二) 程序锁延伸的 之前我已经展示了如何制作程序锁.当打开指定应用的时候,弹出一个密码页 ...
- linux进程模型总结
Linux进程通过一个task_struct结构体描述,在linux/sched.h中定义,通过理解该结构,可更清楚的理解linux进程模型. 包含进程所有信息的task_struct数据 ...
- Oracle Exception 处理
1.问题来源Oracle中可以用dbms_output.put_line来打印提示信息,但是很容易缓冲区就溢出了.可以用DBMS_OUTPUT.ENABLE(1000000);来设置缓冲区的大小.但是 ...
- WCF 下的windows服务的安装卸载
安装:启动vs2010(如果是win2008要以管理员来启动)命令:installutil demo.exe 卸载:先在服务里停止这个服务,然后启动vs2010(如果是win2008要以管理员来启动) ...
- Android init进程概述
init进程,其程序位于根文件系统中,在kernle自行启动后,其中的 start_kernel 函数把根文件系统挂载到/目录后,在 rest_init 函数中通过 kernel_thread(ker ...
- Smallest unused ID
http://www.codewars.com/kata/smallest-unused-id Description: Hey awesome programmer! You've got much ...
- 使用ANT打包Android应用
大家好,今天来分享一下如何使用ANT打包Android应用. 通常我们习惯用eclipse来开发Android程序,它会自动帮我们打包当前的应用程序.如果在Navigator视图下,我们可以看到以下几 ...
- JS将下拉框的disable变为able的方法
在jquery中可以通过jqueryObj.attr("disabled","disabled")将页面中某个元素置为不可编辑或触发状态,但是在jquery的A ...