usb

Android 3.1 USB-Host - BroadcastReceiver does not receive USB_DEVICE_ATTACHED

£可爱£侵袭症+ 提交于 2019-12-17 07:07:48
问题 I worked through the description and samples for USB host at developer.android.com to detect attached and detached USB-devices. If I use an intent-filter in the manifest file to start my application when a device is attached, it works perfectly fine: Plug in, device is detected, android asks for permission to start the application, device information is displayed in a table. The application I'm developing shouldn't be started/finished only if a device is attached/detached (e.g. data

Simple way to query connected USB devices info in Python?

隐身守侯 提交于 2019-12-17 06:26:18
问题 How can we query connected USB devices info in Python? I want to get UID Device Name (ex: SonyEricsson W660), path to device (ex: /dev/ttyACM0) And also what would be the best Parameter out of above info to be used as identifying the device whenever it's connected again? (UID?) I am working on Ubuntu 11.04. ATM I have this code (using pyUSB) busses = usb.busses() for bus in busses: devices = bus.devices for dev in devices: print repr(dev) print "Device:", dev.filename print " idVendor: %d (0x

Safely remove a USB drive using the Win32 API?

♀尐吖头ヾ 提交于 2019-12-17 04:27:49
问题 How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware. Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a day. I'd love to write a little program to do exactly that so I can put it into my makefiles, but I haven't found any API call that does the same thing. Any ideas? 回答1: You can use the CM

Safely remove a USB drive using the Win32 API?

六眼飞鱼酱① 提交于 2019-12-17 04:27:02
问题 How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware. Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a day. I'd love to write a little program to do exactly that so I can put it into my makefiles, but I haven't found any API call that does the same thing. Any ideas? 回答1: You can use the CM

USB device access pop-up suppression?

我只是一个虾纸丫 提交于 2019-12-17 02:34:17
问题 This question was migrated from Android Enthusiasts Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . When a USB device is connected to the Android tablet, a pop-up appears asking for user-permission. I want to suppress this as the client does not want it. How should I go about that? In the code: UsbManager.requestpermission(); is called to give the USB device temporary access. This throws a pop-up. How do I suppress the pop-up or grant access to the user by

Android Honeycomb 3.2 detect MTP connection via USB

陌路散爱 提交于 2019-12-14 03:53:16
问题 I saw other posts about detecting a USB connection, but they didn't talk about MPT specifically and just a more general detection so I figured I'd ask specifically about MTP. I'm connecting my Xoom to the computer via USB and I want my app to write a file out when the MTP connection is established. When the USB is disconnected and the MTP server has stopped I want to write out another file. So I want to detect both the connected and not connected cases. I can't seem to find any kinds of

How to run an API made for 32-bit on a 64-bit machine?

╄→尐↘猪︶ㄣ 提交于 2019-12-14 03:45:00
问题 I'm writing a java application which has to communicate with has to communicate with an XBee radio over a usb-cable.To do this , I use the xbee-java API (http://code.google.com/p/xbee-api/) On my old 32-bit machine it all worked fine . But when I imported the project to a 64-bit machine , it throws immediately an exception which says :" Can't load IA 32-bit .dll on a AMD 64-bit platform" . I don't have any idea how I can solve this problem . the error code : java.lang.UnsatisfiedLinkError: C:

Ubuntu RXTX does not recognize usb-serial device

房东的猫 提交于 2019-12-14 00:23:46
问题 I'm connecting a device with librxtx-java to Ubuntu. The code previously worked in 10.04, but in 12.04 it can't discover the usb-serial connected to the computer. java.util.Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println( portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } This section of the code never goes

How can I determine the length of received bytes of UsbRequest.queue(..) method?

醉酒当歌 提交于 2019-12-14 00:23:17
问题 I have troubles with UsbRequest class in Android 3.1. This is my code: ByteBuffer buffer = ByteBuffer.allocate(4096); buffer.order(ByteOrder.LITTLE_ENDIAN); UsbRequest request = new UsbRequest(); request.initialize(mConnection, mEndpointIn); request.queue(buffer, 4096); if (mConnection.requestWait() == request) { byte[] data = buffer.array(); } The size of array data is 4096, but the length of really received bytes is much more smaller. How can i determine the size of really received bytes?

eclipse or android studio not recognize my phone on usb debugging mode

柔情痞子 提交于 2019-12-13 19:09:51
问题 I have huawei ascend G7, I turn on USB debugging on my phone and connect it to my PC using a USB cable. the problem is that I have to turn on Usb storage mode if I want eclipse or android studio recognize my phone. and you know it cause mounting and unmounting sd-card! is there any way to prevent from mounting or unmounting sd-card? or force eclipse or android studio to recognize my phone on [charge only] mode? 回答1: try using this PDAnet .. generic device driver for all android devices http:/