I am developing an application in which I have to put as well as get some files from Computer(i.e Windows system) using USB.
I searched the web but didn't get anything helpful. I have an idea about command line so I am able to do this by using commands like
./adb -s emulator-5554 pull /sdcard/juned.jpg c:/user/juned/images/
It will copy juned.jpg file in specified directory of system, but is it possible to run same command programmatically ?
Till now I got one sample application in Android Samples named AdbTest
which is available under /root/android-sdks/samples/android-18/legacy/USB/
directory, I have tried to compile that application but it shows nothing.
In that application under xml
directory device_filter.xml
file is there. In that file
<resources>
<usb-device class="255" subclass="66" protocol="1" />
</resources>
What value should I provide to make it working with my device ?
And is it possible to run adb
commands from indide an application programmatically?
Edit
So far I came to know that, adb command can not be executed in non rooted devices, so is there any other way to transfer files using USB ?