title: PDF in android for API 17+
body: <p>Please, how do i display a pdf stored in my assets folder in my application.  I have tried looking around but i see PdfRenderer supports  AP1 21. I want to support API 17 and upwards. Thanks.</p>
  
  <p>i have tied a few samples </p>
  
  <pre><code>File pdfFile = new File(Environment
     .getDataDirectory(), "file:///android_asset/abstract.pdf");
  
      try {
  
          if (pdfFile.exists()) {
  
              Uri path = Uri.fromFile(pdfFile);
              Intent objIntent = new Intent(Intent.ACTION_VIEW);
              objIntent.setDataAndType(path, "application/pdf");
              objIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              startActivity(objIntent);
          } else {
  
              Toast.makeText(WebShow.this, "File NotFound",
             Toast.LENGTH_SHORT).show();
          }
      } catch (ActivityNotFoundException e) {
  
          Toast.makeText(WebShow.this,
  
                  "No Viewer Application Found", Toast.LENGTH_SHORT)
                  .show();
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>i saw online but i don't know how to get around it (.getDataDirectory())because i get "file not found"</p>