6

I would like to read-write a file in USB drive OTG programatically.

Use case is following:

  1. User connects an USB OTG to Nexus 10 device.
  2. My App will get notified that USB is connected. (achieved)
  3. My App will read some files from the USB drive
  4. My App will make some changes on the files.
  5. My App will write the files back to USB drive.

I am writing the android app for Lollipop devices. Any help is appreciated. Thank you.

tausiq
  • 937
  • 1
  • 13
  • 23
  • you are trying to achieve this using USBManager or no required just want to achieve with any method?. – IshRoid Feb 27 '15 at 11:05
  • 1
    A search (or even the related sidebar on your screen) will show that this has been covered here many times before. You won't like the answers, which are that for stock devices you need to develop or adapt both USB Mass Storage and Filesystem code yourself to include in your app. – Chris Stratton Feb 27 '15 at 13:32
  • if developing or adapting both USB Mass Storage and Filesystem code by myself is the solution, then I am wondering why there isn't any library that do this task? Or, any file explorer app (example, ES file explorer) could provide an intent that can be used to achieve the functionality. – tausiq Feb 27 '15 at 19:45
  • @Ishrat, any method will work for me. I just need to achieve the functionality. – tausiq Feb 27 '15 at 19:51

0 Answers0