2

I am creating a magazine android app in which i need to download the PDF from a URL then open the downloaded document in the app itself using web view.

I have tried loading directly URL into web view using google docs but that does not work as the the PDF itself is quite big.

2 Answers 2

4

Simply use this :

    String URL="http://yourdomain.in/yourpdf_file.pdf";

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
     fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            globalProgressDialog.ProgressDialogShow(MainActivity.this);

            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(URL));
            startActivity(browserIntent);

            globalProgressDialog.dismissProgressDialog();


        }
    });
1
  • This just opens a up a browser man!
    – Robin
    Oct 14, 2022 at 10:56
0

Loading a pdf file using google docs isn't good idea. Because there is

the bandwidth limit for viewing or downloading files that aren't in Google Docs format

I advice you to use this library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.