Reputation: 53
I'm trying to get my computer, which is running Linux, to send and receive data to and from an Android app using an USB cable. I tried using the UsbDeviceConnection
class but the usbdevice
object returns null
and is not picking up my Android device. Is there is any fix for this or any other way to create a communication over USB?
Upvotes: 3
Views: 665
Reputation: 75
You might want to look into ADB (Android Debug Interface). It offers a number of useful tools to communicate with your Android device and apps on it. There are simple push/pull commands which allow you to move files back and forth between your computer and Android device, just to name a couple.
As far as your usbdevice
object returning null
, have you checked to see if USB Debugging is On
on your device?
Also: here is a similar question that might help: How can I send messages back and forth between ADB shell and an Android app?
Upvotes: 1