0

I am developing android application where I need to transfer bytes from android device (host) to another device which runs on windows via USB.

I came across libusb library which only works on host mode, so I am developing an android application for android tablet which will act as host and need to communicate with a machine where windows OS runs.

Machine which runs windows always act as host, correct me If I am wrong?

So in my case both are host so things are not going to work. Afaik, in a communication one need to be a host and rest peripherals.

Does anyone have any idea how I can make it work ?

N Sharma
  • 33,489
  • 95
  • 256
  • 444
  • If your phone must be a client I can see couple ways of communication, it depends on how many data you need to transfer. – once2go Jul 07 '17 at 21:49
  • You going to "root" your android device? – fghj Jul 07 '17 at 21:58
  • @once2go Just few bytes I need to transfer. – N Sharma Jul 08 '17 at 05:49
  • @user1034749 I will do if there is any work around only for rooted devices. – N Sharma Jul 08 '17 at 05:53
  • @user1034749 do you know something that will work for rooted device ? – N Sharma Jul 09 '17 at 08:22
  • On rooted devices Android become fully controlled Linux, so you for example you can remove default usb handling code and load https://www.kernel.org/doc/Documentation/usb/gadget_serial.txt so windows see you device as com port, and using standard API you can transfer bytes. – fghj Jul 09 '17 at 08:26
  • https://stackoverflow.com/a/21749521/3612976 does this suitable for you? Or this app must be in production(in play market)? – once2go Jul 10 '17 at 14:24
  • Yep, I did some kinda – N Sharma Jul 10 '17 at 15:18

0 Answers0