I’m new to programing and trying to open a pdf to view in my app. I’m not trying to include a reader “in” my app, but send it to what ever pdf reader the user has.
I’ve searched through all the questions here and found this one Render pdf.
I made a test app and it worked! The only problem is the end user has to save/launch the file from their SD card. I would like to include the PDF’s “inside” the app.
So my question is:
- Where should I store the pdfs?
- How would I direct the app to them?
This is a snippet code for launching from the SD card, I would guess it’s what needs changed:
public void onClick(View v)
{File file = new File ("/sdcard/download/2011_BASIC.pdf");
Wow I can’t believe no one answered this! I have found the answers my-self. I am posting them to help others and save them the time it took me to figure it out.
Question 1. The files should be stored in the /res/raw folder (make the folder if it is not there)
Question 2. The path is simply (“/app_name/pdf_name”) quick note use %20 for spaces in the apps name.
-Nick