usb-otg

How to enable serial port on the Raspberry Pi Zero USB OTG port?

大兔子大兔子 提交于 2019-12-11 01:22:16
问题 The Raspberry Pi Zero comes with USB OTG port. After some reading about OTG driver it seems that it could be configured as CDC device like serial port. So I was wondering if it is possible do so with the Pi Zero? 来源: https://stackoverflow.com/questions/34062133/how-to-enable-serial-port-on-the-raspberry-pi-zero-usb-otg-port

How to check usb host support on android device programmatically?

妖精的绣舞 提交于 2019-12-10 18:32:27
问题 I know that it was supported starting Android 3.1, i mean "how to check hardware support" 回答1: See: http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_USB_HOST context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_USB_HOST); 回答2: I had the same question and after some googling I found this: http://android.serverbox.ch/?p=549 In summary, your app needs to use the UsbManager system service and enumerate through attached USB devices. mUsbManager

How to check whether Android device supports OTG features programatically

蹲街弑〆低调 提交于 2019-12-10 18:10:00
问题 I want to check whether a device supports OTG features programatically . I have tried a lot about this in Internet but could not find any thing . How can I do that ? 回答1: thnx to @CommonsWare: How to detect if Android has full USB support or not? The official way to determine if the device has USB host capability is to use the associated system feature. Ideally, add a <uses-feature> element to your manifest, indicating that you are interested in the android.hardware.usb.host feature. OR use

How usb OTG works(master/slave)

*爱你&永不变心* 提交于 2019-12-08 04:24:04
问题 A device has usb OTG Following is scenarios when a device connected to PC ,then device act as slave (how device knows it has to act as slave) when a device connected to printer ,then device act as master. (how device knows it has to act as master) what are the steps executed when device connected to OTG. how to implement this mechanism (in brief)? 回答1: The exact behavior of USB OTG devices is described in the specification you can find at usb.org. There is a PDF inside the zip called USB_OTG.

How to read/write external USB storage on Android?

别等时光非礼了梦想. 提交于 2019-12-07 07:25:41
问题 I am currently making an app that needs to be able to read from and write to a USB flash drive connected via a USB OTG adapter. Is there an easy way to access this storage via standard Java.io.File APIs? This app is only going to be run on a rooted Motorola Xoom running Android 4.2.2. Any suggestions would be appreciated. 回答1: USB Drives get mounted to your device just like an SDCard does essentially*. The mount path usually resides at: /storage/usb0/ I have not used this on many devices

How can I read files from usb device on android?

自古美人都是妖i 提交于 2019-12-07 05:19:04
问题 I'm trying to create something like file explorer through connected usb devices(via OTG or usb ports on android TV). All I need for this is a path something like "/storage/sda4" and device identifier, and then I can work with device through simle android class File. Is sounds simple but I can't find any info about this, but all file explorers can do it (for example ESExplorer). Ok, I find a simple way to get all connected usb devices with identifier UsbManager usbManager = (UsbManager)

How To Detect that Android Device is connected with USB OTG Or Not programmatically

我怕爱的太早我们不能终老 提交于 2019-12-05 17:41:43
问题 I am working with custom OTG fingerprint scanner. I want to check that OTG is connected to my Android device or not in a specific android activity. 回答1: public class BootUpReceiver extends BroadcastReceiver { private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION"; String TAG = "OTG "; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); // Log.e("USB", "Decive Connected -> " + action); //Initilizing globel

How can I read files from usb device on android?

丶灬走出姿态 提交于 2019-12-05 10:49:48
I'm trying to create something like file explorer through connected usb devices(via OTG or usb ports on android TV). All I need for this is a path something like "/storage/sda4" and device identifier, and then I can work with device through simle android class File. Is sounds simple but I can't find any info about this, but all file explorers can do it (for example ESExplorer). Ok, I find a simple way to get all connected usb devices with identifier UsbManager usbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE); usbManager.getDeviceList(); but how can I get an info about

android ADK - USB OTG (Host mode)

旧时模样 提交于 2019-12-05 06:46:24
问题 I am just starting to get into android soft dev and will be designing accessory hardware to interface the android device. It appears that there are some limitation in what USB modes can be used on the device dependent on the firmware. Based on a documentation on USB from the developer.android.com site. USB host mode is only supported on firmware versions 3.1 and up. However, it appears that the samsung galaxy 2 supports OTG (host mode), at least natively, as demonstrated in this youtube video

How to read OTG USB storage

南楼画角 提交于 2019-12-03 09:02:20
I want to read/write OTG USB storage from device. For that I have written the code below but it shows only the SD card. HashSet<String> out = new HashSet<String>(); String reg = "(?i).*vold.*(vfat|ntfs|exfat|fat32|ext3|ext4).*rw.*"; String s = ""; try { final Process process = new ProcessBuilder().command("mount") .redirectErrorStream(true).start(); process.waitFor(); final InputStream is = process.getInputStream(); final byte[] buffer = new byte[1024]; while (is.read(buffer) != -1) { s = s + new String(buffer); } is.close(); } catch (final Exception e) { e.printStackTrace(); } // parse output