I am looking for a solution which uses Android API to transfer a text file from an Android powered device to a computer through USB cable. I have found USB host but I cannot use this because the computer can not act as a device for the Android host.
Do you have any suggestions how I can achieve this?
AirDroid Personal is a must-have program for everyone looking for the simplest and smoothest way to wireless share or transfer data from one device to another. AirDroid, unlike other programs, also allows you to check and respond to phone notifications from your computer.
Possible Reasons File Transfer is disabled on your Android phone or tablet. The USB cable you're using to connect both devices is damaged or malfunctioning. Similarly, it can be an issue with the USB port on your Mac. So, try using another port or change the cable to confirm.
I have solved this problem by using adb status-window
to continuously check for device status, and when a new device is connected, the required files are transferred to the computer using adb pull
command.
In order to achieve a portable solution (i.e. to run independently of Android platform), I just copied the files 'adb.exe' and 'AdbWinApi.dll' into my application and used the adb from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With