Send file to computer system using USB

前端 未结 2 1362
生来不讨喜
生来不讨喜 2021-01-15 23:06

I have such requirement in which i have to transfer file on computer system, lets consider windows PC.

What i want to do is i have one screen with specific details,i

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-15 23:47

    I think your question is not very specific to be answered. But to explain a bit consider the following:

    • you have to turn your android device in USB host mode so that it enumerates connected USB devices
    • establish a connection to your receiving device. Probably this is going to be a storage or drive with a known configuration of endpoints
    • when established, use a function like bulkTransfer(UsbEndpoint endpoint, byte[] buffer, int offset, int length, int timeout), which is documented as well in the link you provided. Keep in mind to choose the correct endpoint (direction TO your storage / drive)

    This is just a sketch to get you started. It's clear that there is a lot more to do..

提交回复
热议问题