title: Android: manage USB memory and files
body: <p>Good afternoon to all.</p>
  
  <p>I'm working on Android 4.0.3 (API 15).</p>
  
  <p>I'd need to make an application that mounts automatically a USB stick (when connected), copies some files from it to internal file system and unmounts it (when finished the copy).</p>
  
  <p>I'm getting crazy to mount/unmount the mass storage:</p>
  
  <p>I tried to use the methods contained in <strong>IMountService.java</strong> (under android.os.storage) that allows to mount/unmount storage from a given mount point (i.e. unmountVolume or mountVolume) but, when I invoke them, the application crashes.</p>
  
  <p>You can find IMountService.java class at the following link:</p>
  
  <p><a href="http://source-android.frandroid.com/frameworks/base/core/java/android/os/storage/IMountService.java" rel="nofollow">http://source-android.frandroid.com/frameworks/base/core/java/android/os/storage/IMountService.java</a></p>
  
  <p>I also tried to obtain the mount/unmount permissions in the manifest:</p>
  
  <pre><code>&lt;uses-permissions android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /&gt;
  </code></pre>
  
  <p>but nothing...</p>
  
  <p>I've looked deeply in the forum (and on all the resources I found) but I have no idea...maybe the device must be rooted to do this operation?</p>
  
  <p>Can someone help me to find an easy way to mount and unmount external storages?</p>
  
  <p>thank you in advance</p>
  
  <p>Alessandro</p>