How does Chrome implement WebUSB on Android?

Viewed 1299

As I understand it, a native Android app must go through a special API to use Host mode which involves the USB OTG spec. However, the WebUSB spec appears to address host mode as the only option (such as on a normal computer) and doesn't mention OTG, so presumably the code for the is all inside Chrome. How does Chrome handle WebUSB on Android, and would that require code modifications vs desktop?

1 Answers

There shouldn't be any modifications needed to share code between Android and desktop. Chrome uses the Android USB host API to communicate with devices. When using an "OTG adapter" this is the API that can be used to communicate with the device. WebUSB does not support the Android-specific "accessory mode."

Related