usb-otg

Android USB OTG: programmatically turn off power to the port

最后都变了- 提交于 2019-12-03 06:50:04
问题 Suppose I have a USB-powered LED lamp connected through a USB OTG adapter to a Toshiba Excite 10 tablet running Android 4.0.3, which provides the power. I want to programmatically turn the USB OTG host port's power pins on and off from an app. (Ideally without root, but I'll take what I can get). Any ideas? 回答1: You must have write permission on /sys directory. Rooting makes the process very easy. Just root your device and issue the right echo command to toggle kernel status bits like :

Android USB OTG: programmatically turn off power to the port

橙三吉。 提交于 2019-12-02 21:24:13
Suppose I have a USB-powered LED lamp connected through a USB OTG adapter to a Toshiba Excite 10 tablet running Android 4.0.3, which provides the power. I want to programmatically turn the USB OTG host port's power pins on and off from an app. (Ideally without root, but I'll take what I can get). Any ideas? You must have write permission on /sys directory. Rooting makes the process very easy. Just root your device and issue the right echo command to toggle kernel status bits like : String[] command = { "/system/bin/sh", "-c", "echo xxx > /sys/bus/usb/devices/usb3/power/level", }; Runtime

Transfer Files USB Mass Storage OTG

妖精的绣舞 提交于 2019-12-02 09:52:45
问题 I have an external mass storage device connected to an Android device. There are several .BIN files in the root directory that I need to read into my app. I am able to connect to the device and receive usb permission using UsbDeviceConnection. private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String output = outputTV.getText().toString(); String action = intent.getAction(); outputTV.setText(outputTV

Transfer Files USB Mass Storage OTG

雨燕双飞 提交于 2019-12-02 07:01:23
I have an external mass storage device connected to an Android device. There are several .BIN files in the root directory that I need to read into my app. I am able to connect to the device and receive usb permission using UsbDeviceConnection. private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String output = outputTV.getText().toString(); String action = intent.getAction(); outputTV.setText(outputTV.getText() + "\n" + " ACTION: " + action); if (ACTION_USB_PERMISSION.equals(action)) { synchronized (this) {

Path of OTG in Android device

梦想的初衷 提交于 2019-12-01 06:24:44
I am developing an Android application in which I have to get details of USB device connected to Tablet via OTG . when I use sys/bus/usb0/devices then I am getting list of all devices of Tablet while I want to only fetch device name attached via OTG port . Is there ant way to get which device is in built and which device is connected to Tablet. When I used path /storage/usb0/ and /storage/usbdisk0 / , then I didnt get any device whicle device is attached via OTG port. Please can anyone tell me how can I get the USB details attached via OTG port to Tablet Below example link provides data like :

Path of OTG in Android device

╄→尐↘猪︶ㄣ 提交于 2019-12-01 03:31:48
问题 I am developing an Android application in which I have to get details of USB device connected to Tablet via OTG . when I use sys/bus/usb0/devices then I am getting list of all devices of Tablet while I want to only fetch device name attached via OTG port . Is there ant way to get which device is in built and which device is connected to Tablet. When I used path /storage/usb0/ and /storage/usbdisk0 / , then I didnt get any device whicle device is attached via OTG port. Please can anyone tell

How app can access files on USB OTG storages in Android 6.0 (API level 23) without root?

雨燕双飞 提交于 2019-11-27 13:59:31
Android 6.0 Developer Preview (API level 23) can natively mounts external removable USB OTG storages out-of-the-box without any additional apps (for more info please see: https://www.androidpolice.com/2015/05/28/android-m-feature-spotlight-external-storage-can-be-adopted-as-true-internal-storage-or-accessed-normally-with-no-additional-apps/ ). When user connects USB OTG storage, it shows up in the system storage menu and it is accessible with the built-in file manager. User can access all files on the USB OTG external storage using the new built-in file manager without root rights. When I

Communicating with serial USB device over Android

和自甴很熟 提交于 2019-11-27 06:59:22
I have one custom made device for measuring current. This device can be connected to PC and communication is done over USB. It is based on FTDI chip. I have application written in Java and that application is using rxtxSerial.dll library and gnu.io.rxtx_2.1.7.4.jar. Now I want to port this application on my android device and I'm litte bit confused what to do that? All I have is android tablet (os version 4.1.1), OTG cable and this measuring device. Should my device be rooted? Is there any kind of library that I can simply add to my Java Android application and read data over USB? Where to

Communicating with serial USB device over Android

隐身守侯 提交于 2019-11-26 10:35:41
问题 I have one custom made device for measuring current. This device can be connected to PC and communication is done over USB. It is based on FTDI chip. I have application written in Java and that application is using rxtxSerial.dll library and gnu.io.rxtx_2.1.7.4.jar. Now I want to port this application on my android device and I\'m litte bit confused what to do that? All I have is android tablet (os version 4.1.1), OTG cable and this measuring device. Should my device be rooted? Is there any