View PDFs in the Android app

Asked 2 years ago, Updated 2 years ago, 84 views

I'm very frustrated that I can't see PDF files that are out of the box on Android (WebView or any other way).

So what I'm curious about is if you have (OS) JARs or classes that will allow you to view PDF documents within the app.

Has anyone ever used the standard Java PDF viewer library on Android? The Library doesn't have to be free, it just works on Android phones.

I heard that iTunes was ported for Android. Has anyone used it yet?

android pdf

2022-09-22 21:25

1 Answers

Code link to open PDF

public class MyPdfViewActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WebView mWebView=new WebView(MyPdfViewActivity.this);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setPluginsEnabled(true);
    mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+LinkTo);
    setContentView(mWebView);
  }
}


2022-09-22 21:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.