I have such requirement in which i have to transfer file on computer system, lets consider windows PC.
What i want to do is i have one screen with specific details,i
I think your question is not very specific to be answered. But to explain a bit consider the following:
bulkTransfer(UsbEndpoint endpoint, byte[] buffer, int offset, int length, int timeout),
which is documented as well in the link you provided. Keep in mind to choose the correct endpoint (direction TO your storage / drive)This is just a sketch to get you started. It's clear that there is a lot more to do..
USB is probably not very suitable for what you want to do.
USB is asymmetrical, that is, a USB connection has a host at one end and a peripheral device at the other end. (For example, when you plug a USB stick into a PC, the PC is the host and the stick is the peripheral.) The host initiates and controls data transfers.
An Android phone generally acts as a peripheral device. As of Android 3.1, the phone can also act as a USB host, though not all phones support this.
In order to accomplish what you have in mind, the PC would need to run a piece of software that changes it from host mode to peripheral mode, and exposes some kind of storage that the Android device could then write to.
Maybe Bluetooth is a better option for you. You could just initiate a file transfer over Bluetooth as soon as the file changes. Inexpensive USB Bluetooth dongles are available for PCs without Bluetooth support. You might still need some software on your PC if you want to automatically accept the file transfer request on the PC.