How can I detect if a USB device is connect to my android phone by
pressing a button?
I am writing an app on my android phone (Samsung s3) to communicate with a
device. The device connects to my phone via usb. I have a button on the
app that sends data from my phone to the device. If the cable is connected
the button works. However if the device is not connected to my phone, the
app crashes. I want to test if a usb device is connected to my phone
before I sending the command to the device. Please how do I do this?
No comments:
Post a Comment