I wanted to include some pdf in an app as a built-in pdf, like when I share that app on to other device and open the app, it should contain the pdf. Edit: Actually I want to make an app which should include abc.pdf in it.All I wanted to do is add pdf inside an app and produce the app such that when I install the app on my phone , the app should contain the abc.pdf and it can be accessed by a button.
- 2Android does not have a built-in PDF viewing app. Please explain, in detail, what you mean by "I share that app on to other device and open the app,it should contain the pdf".CommonsWare– CommonsWare2017-05-04 11:39:34 +00:00Commented May 4, 2017 at 11:39
- Can you edit to add more details?OneCricketeer– OneCricketeer2017-05-04 11:55:20 +00:00Commented May 4, 2017 at 11:55
- yes I have edited plese respondRanjith Kumar– Ranjith Kumar2017-05-04 15:49:24 +00:00Commented May 4, 2017 at 15:49
2 Answers
I think what you are after is the asset folder and putting your file in there and then reading it. An asset is anything an android app may use which is not part of the app-structure itself such as ui components, ui image resources or code.
You need to read your pdf from the assets and then you can make the android system show it by using an appropriate app.
Check out this question:
Comments
if those pdf files are static and you have fixed number of pdf files you can add them to the assets but if those pdf files are changing then you need to have a web service in which you have to store those pdf files so that they will be shared to all users