title: Use file:/// command to index files in an android web browser
body: <p>I want to open remotly and offline a pdf file in an android webview which it locate on my NAS in my Home LAN.</p>
  
  <p>I tried this but i had a network error in the webview (Web page not available)  :</p>
  
  <p><img src="https://i.stack.imgur.com/pImr2.jpg" alt="enter image description here"></p>
  
  <pre><code>public void OpenPDF(String Path) {
    try {
      WebView webView=new WebView(ListDir.this);
      webView.getSettings().setJavaScriptEnabled(true);
      webView.getSettings().setPluginState(PluginState.ON);
      webView.setWebViewClient(new Callback());
      Log.i("",""+"file://"+Path);
      webView.loadUrl("file:///"+Path);
      setContentView(webView);
   }
   catch(Exception e) {
     Toast(""+e);
   }
  }
  private class Callback extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(
              WebView view, String url) {
          return(false);
      }
  }
  where Path = 192.168.0.254/Disque dur/AffichePDF.pdf 
  
  The Log.i = 07-23 15:15:43.523: I/(7988): file:///192.168.0.254/Disque dur/AffichePDF.pdf
  </code></pre>
  
  <p>Chrome android tells ERR : 10 ERR_ACCESS_DENIED on my s3 and Network error on default browser. Does any configuration should be done on the device to use file:/// ?</p>
  
  <p>The path file:///192.168.0.254/Disque dur/AffichePDF.pdf works fine on my PC and i can navigate and list files on my NAS from my app.</p>
  
  <p>Somebody knows a tip to do that working ?</p>
  
  <p>Thanks</p>