Actually I know how to open a pdf file from assets folder in android app.But now I want to download a pdf from url and store it on sdcard.when the pdf is downloaded it show in the app.Once the pdf is downloaded then "view" will show other wise it shows "download"
Asked
Active
Viewed 1,425 times
-1
-
2Possible duplicate of [How to download a pdf file in Android?](https://stackoverflow.com/questions/6368788/how-to-download-a-pdf-file-in-android) – tomerpacific May 30 '19 at 08:47
1 Answers
0
If you encounter any issues with the pdf download here is the link:
android download pdf from url then open it with a pdf reader
If you have already done this then you can simply create a SharedPreferences boolean to store weather true if you successfully completed the download process or false if you didin't download it or removed the pdf. Once your app will start check everytime the boolean value and display view or download according to it's value.
Documentation for shared pref: Android Shared preferences example

Flavian Bulancea
- 15
- 4