usb

Android USB API: Switch between charge and data send

醉酒当歌 提交于 2019-12-22 04:43:20
问题 I'm starting to use the Android USB API to send data from an Arduino to an Android device. Is it possible to programmatically switch between send/receive data and just charge the Android phone? I know that you cannot do both things at the same time, and, since you have to open a FileInputStream in order to be able to receive data, as long as this is open the device won't be charged. Will it be just as simple as closing this stream to charge again? If is as simple as it, can the Arduino then

How to make a usb connection within an android app

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 00:29:32
问题 has anyone an idea how to make an usb-connection in an android ap to a Desktop Applicaktion? some data has to be synced when the device is connected via USB... - by workflow this may not be done over the air :( 回答1: USB is not part of the APIs exposed by the Android SDK, sorry. 回答2: With the release of android 3.2 this has been changed - USB becomes supported :) Link: Android SDK USB handling changed 来源: https://stackoverflow.com/questions/5855024/how-to-make-a-usb-connection-within-an

Carrying and Working on an Entire Development Box from a USB Stick. Feasible?

好久不见. 提交于 2019-12-21 23:17:17
问题 Lately I have been thinking about investing in a worthy USB pen drive (something along the lines of this), and install Operating Systems on Virtual Machines and start developing on them. What I have in mind is that I want to be able to carry my development boxes, being a Windows Distribution for .Net development and a Linux Distribution for stuff like RoR, Perl and whatnot, so that I would be able to carry them around where need be...be it work, school, different computers at home etc... I am

How to disable android device usb port

橙三吉。 提交于 2019-12-21 21:57:04
问题 I am trying to search if there is a way to disable android device usb port, software level mainly. So users can still charge android device but cannot communicate with PC anymore. I got some clues in link1. But it looks there is not an easy way for this. Android OS is a Linux based OS. So I am wondering if there is a config file in Android OS that allows root users to disable usb port, like files under path /etc in Linux OS. 回答1: EDIT: Use this command in android terminal emulator. Root

Generic printing using a USB port

可紊 提交于 2019-12-21 21:39:05
问题 I am developing on a device that has no printer support natively. I need to print to any printer using a USB port. Is this feasible? Is there any generic standard for all printers to print via USB? The device runs on Linux/PowerPC. 回答1: Sure. There's the USB Printer Class (PDF, 11 pages). It seems to require that the host present data to the printer in either PDL or PCP formats. Remember that USB printers are generally "dumber" than Ethernet-connected printers, and require the host to do more

Android USB Host. How do I get permission to use USB devices without displaying a dialog?

三世轮回 提交于 2019-12-21 21:28:58
问题 There android device without a screen . When connecting the USB device automatically appears the system dialog to permit the use of USB. It is necessary to obtain a permit without using the device's screen . It is assumed that the device application will be installed in advance, and when the USB device is connected automatically. How exactly this can be done? 回答1: I made by analogy in the topic. Classes for the correct version of SDK took away. I create the necessary packages and copied to

How to send hid data to device using python / pywinusb?

点点圈 提交于 2019-12-21 21:25:31
问题 I'm trying to use pywinusb to send output report to a pic18f4550. The device can receive data, and I've tested it with a C# application, which worked fine. Also, I can read data from the device with pywinusb just fine, but I have a problem trying to send data. Here's the code I'm running: from pywinusb import hid filter = hid.HidDeviceFilter(vendor_id = 0x0777, product_id = 0x0077) devices = filter.get_devices() if devices: device = devices[0] print "success" device.open() out_report = device

Is it possible to write a driver for the input system in android

允我心安 提交于 2019-12-21 20:59:49
问题 Is it possible for a public sdk only app write a "driver" to an input device, like a joystick that uses some vague, possibly alien, protocol over USB using the new 3.1 USB Apis? For example, would it be possible to implement a driver for the brand-new-just-out-the-door O-Triangle 3.15 Controller with 13 joysticks and 159 buttons and virtual head tracking and soda dispenser, or would this have to wait for android to be updated with a new low-level driver for the O-Triangle 3.15's controller

NullPointerException when opening HID Device using Java HID API (Managing Inputs from Multiple Keyboards)

做~自己de王妃 提交于 2019-12-21 20:56:46
问题 This question is a possible duplicate of this and this thread. But since none of them have provided a clear solution for my problem, I'm asking it again. My required task is to connect 2 Keyboards via USB and then manage the inputs of each Keyboard separately through a Java Application. This requirement has been answered into some progress in the first thread I have mentioned above by @nan but his solution did not work accurately for me. You can find his blog post on his solution for this

Find mount point of an USB device in OSX

为君一笑 提交于 2019-12-21 20:53:07
问题 In order to share a device between a host and a Docker container, I would like to know the path to the mounting point for a given device, a smartcard reader in this case. Using ioreg -p IOUSB -t , I can see the device (CCID USB Reader) : iMac:~ $ ioreg -p IOUSB -t +-o Root <class IORegistryEntry, id 0x100000100, retain 13> +-o Root Hub Simulation Simulation@fd000000 <class AppleUSBRootHubDevice, id 0x100000257, registered, matched, active, busy 0 (42 ms), retain 7> | +-o IOUSBHostDevice