1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to download PDF in webview

Discussion in 'Android Development' started by d80adc, Feb 20, 2021.

  1. d80adc

    d80adc Lurker
    Thread Starter

    Hi,

    I'm creating a small app which takes me to a webpage where I can download my payslips using the following tutorial.

    https://spdevhost.com/2018/10/how-to-enable-own-download-in-sketchware-app.html

    After I click download, the pdf is downloaded but the contents of the pdf is just the webpage and not the payslip.

    How do I get it to download correctly?

    When I download via the website directly it works but not through the webview in the sketchware app....

    Help
     



    1. Download the Forums for Android™ app!


      Download

       
  2. puppykickr

    puppykickr Android Expert

    Are you using your own webview, or is your app using the built in Android System Webview?

    I have tried using multiple different webviews, and Android System Webview is by far the best and most efficient.
     
    ocnbrze likes this.
  3. Unforgiven

    Unforgiven ...eschew obfuscation...
    Moderator

    Development thread moved to the dev area for better exposure. :)
     
    d80adc likes this.
  4. d80adc

    d80adc Lurker
    Thread Starter

    I'm using the sketchware app builder and using the webview in that application.

    Not sure which one it actually used...

    Regards
     
  5. puppykickr

    puppykickr Android Expert

  6. d80adc

    d80adc Lurker
    Thread Starter

    Hi,

    What I'm hoping to do is to add some additional features (links) which link to other web pages on separate sites.

    I just don't understand why when I use the webview in the app the app downloads a copy of the page you're on but when I navigate to the site externally the browser (chrome, Firefox etc) download the payslip as it's supposed to.

    There must be something that's not configured correctly in the 'on activity create'. But no-one can offer an answer as to why it's doing it ...
     
  7. puppykickr

    puppykickr Android Expert

    Yeah.
    Well, developing an app is one thing.

    Getting one to work is a other.

    Getting one that works and is secure enought to use for your work is yet another still.

    The browsers I put links to above are all FOSS, Free Open Source Software- so that means that you can feel free to decompile, inspect, and see why your app differs in respect to downloading.

    Anyway, try setting one of them up as I mentioned, an see what happens.

    I suggest starting out with Lightning.
     
    mikedt likes this.
Loading...

Share This Page

Loading...