1

Is there an interface or API or something on Android that would allow an app to eject a cable and stop supplying or receiving power from it?

I've looked through USBDevice (Including USBInterfaces) and can't seem to find anything would would replicate a cable being unplugged.

Using the grand old google, I found Controlling a USB power supply (on/off) with linux. Thats near the exact same thing I'm trying to accomplish, but on Android. I thought, given the change in platform, that a new post would be warranted.

Thanks in advance

Community
  • 1
  • 1
Alex
  • 145
  • 1
  • 4
  • 15
  • Eject a cable? No. But you could send a signal to a device that or pulls the cord out of the device or stops the power supply. You need to program IO ports for that. Have a look at `IOIO`. I think you should build your own cable puller device if you want that option. – greenapps Aug 04 '15 at 20:41

1 Answers1

2

I don't believe that this is possible. It's not a question so much of the Android OS as much as the Android Hardware. If a charging cable is plugged in, power is being supplied to the battery to charge it, always. There may be ways to control that in Linux, and maybe even on Windows, but it wouldn't be possible to cut the power from the cable to the battery from inside of the Android OS.

Hope this helps.

SMKS
  • 991
  • 12
  • 21