-2

I followed a video tutorial online about using pdf_renderer to view you app,but unfortunately i got a warning message telling me that pdf_renderer only support API 21 or higher version pls can anyone help me with a link or anything that will be of help.

Aasim Yaz
  • 85
  • 1
  • 4

1 Answers1

1

You'll have to user 3rd party libs, or write your own from scratch if you're using API prior to Lollipop.

Some examples:

Thing is, most of them are paid. So you'll have to purchase a license for your app, use the trial version, or try to find some lib that's free.

EDIT: You could also try to use a WebView and google docs. But that's really not a clean solution, as if Google decide to change this URL some day, it'll break your app.

Example:

WebView webView = new WebView(context_);

webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginsEnabled(true);
webView.loadUrl("https://docs.google.com/gview?embedded=true&url="+LINK_TO_PDF);

setContentView(webView);
Mauker
  • 11,237
  • 7
  • 58
  • 76