title: Android: File listing of web server
body: <p>I am trying to retrieve file listing from my (apache) http server via an android phone. Searched the web and forum without success. I was however able to do this in standard java using:</p>
  
  <pre><code>package at.klp.serverlist;
  
  import java.net.URL;
  import java.util.List;
  import org.apache.ivy.util.url.ApacheURLLister;
  
  public class ServerFileListJava {
  
      public static void main(String[] args) {
  
          URL url1;
          List serverDir;
  
          try {           
              url1 = new URL("http://...url to server...");           
              ApacheURLLister lister1 = new ApacheURLLister();         
              serverDir = lister1.listAll(url1);
              System.out.println(serverDir);         
          } 
  
          catch (Exception e) {
              e.printStackTrace();
          }               
  
      }//end main
  }//end class
  </code></pre>
  
  <p>Is a similar class available in Android, or can file listing somehow be done using org.apache.http*?
  I do not really want to use a WebView, or separate the html code using HttpGet and HttpResponse.</p>
  
  <p>Thanks a lot for helping, any ideas?</p>
  
  <p><strong>Solved thanks to your answers. I imported ivy-2.0.0-rc1.jar into my project, did not know that this works! This video demonstrates how to import .jar`s into an Android project: <a href="http://www.youtube.com/watch?v=eY_uqi_qIz0&amp;noredirect=1" rel="nofollow">http://www.youtube.com/watch?v=eY_uqi_qIz0&amp;noredirect=1</a>
  thanks!</strong></p>