title: Android Host : connection with a Mass storage USB device
body: <p>I am currently trying to develop an application who access xml files on an usb device.
  I have read the Google Documentation about Android USB Host.
  Now i can detect my USB Device, discover its specifications (like PID/VID), but i can't access on the files of the USB device :( </p>
  
  <p>Here is my code of the activity looking for devices :</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_visu);
  
  
    affichage = (TextView) findViewById(R.id.afficher);
    context = VisuActivity.this.getApplicationContext();
    UsbManager manager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
    HashMap&lt;String, UsbDevice&gt; deviceList = manager.getDeviceList();
  
    Iterator&lt;UsbDevice&gt; deviceIterator = deviceList.values().iterator();
  
    if(deviceList.size()==1){
        while(deviceIterator.hasNext()){
               device = deviceIterator.next();
  
        }
  
        UsbInterface mUsbInterface = device.getInterface(0);
        UsbEndpoint endpoint = mUsbInterface.getEndpoint(0);
  
        UsbDeviceConnection connection = manager.openDevice(device);
  
     }
  }
    /* What To Do Now ???? */
  </code></pre>
  
  <p>I have tried to find some example on the internet, but I am lost now ! :(</p>
  
  <p>Anyone knows how to do for read (and eventually write) a file on a USB device ?
  I have heard that there is a Mass Storage protocol to follow, but i don't find or understand it ! </p>