1

I am doing one application to read pdf from sdcard through webview. I used the following code.

 webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.setWebViewClient(new HelloWebViewClient());
    File file = new File(Environment.getExternalStorageDirectory()
            + "/MotoronAug.pdf");
    Uri uri = Uri.fromFile(file);
    webview.loadUrl(uri.toString());

but i got a blank page. But when i give a web address

webview.loadUrl("http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf");

I can read it from webview what is the problem in my code?...I have MotoronAug.pdf file in my sdcard.Help me friends

sarath
  • 25
  • 1
  • 5

1 Answers1

0

Online or local both wont be rendered by webview.

eminemence
  • 721
  • 1
  • 6
  • 21
  • is there any framework in android like quartzcore in IPhone to support pdf reading – sarath Mar 14 '12 at 04:53
  • I don't know what this quartzcore is, but if you have to detect pdf support, check this : http://stackoverflow.com/questions/4901104/reliably-detect-pdf-support-on-android-device – eminemence Mar 14 '12 at 07:06