title: Android HTML code printing before KitKat (before api 18)
body: <p>I'm looking for an easy way of making this printing HTML code fragment compatible backwards with older Android versions:</p>
  
  <pre><code>@TargetApi(Build.VERSION_CODES.KITKAT)
  private void createWebPrintJob(WebView webView) {
  
      // Get a PrintManager instance
      PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE);
  
      // Get a print adapter instance
      PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter();
  
      // Create a print job with name and adapter instance
      String jobName = getString(R.string.app_name) + " Document";
      PrintJob printJob = printManager.print(jobName, printAdapter, new PrintAttributes.Builder().build());
  
      // Save the job object for later status checking
      mPrintJob = printJob;
  }
  </code></pre>
  
  <p>This works from Android 19 (Kit-Kat), but i need some previous versions to work also.</p>
  
  <p>I don't need to download and print a webpage from the internet, i already have the HTML code as a String, which i show in a webview (as yo can see in the code).</p>
  
  <p>Is there an easy way of printing HTML code before Android 19?</p>
  
  <p>Thanks in advance!</p>