Android USB OTG: programmatically turn off power to the port
问题 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 :