0

Is there a way to my App (React Native) detect that the device is connected with the PC?

I have this application that needs to detect if the device (Android) is connected with the PC (Windows) via USB, and then make some procedures. A simple return with true||false would be enough. Something like calling the function:

isConnectedViaUSB() // returns true or false.
Felix
  • 124
  • 1
  • 4
  • 15
  • 1
    i think you'd better write your own native modules, these link could be useful: https://stackoverflow.com/questions/30182172/android-how-to-detect-already-connected-usb-device and https://stackoverflow.com/questions/4600896/android-detecting-usb – Quang Thái Jul 06 '21 at 03:26
  • Yeah, I was trying to find a shortcut for that because there are so many other things to do and I need so little of this function. But thank you for the links, they're very useful! – Felix Jul 06 '21 at 17:23

0 Answers0