After certain research and lookup over the internet I found that I cannot place these files in the assets folders as those files will be private to my application, I want the native pdf application to be invoked on a button press which redirects the user to the particular document. What I am confused about is how do I bundle the files with my application so that when the user downloads or installs my application these files get stored in her SD-Card.
Asked
Active
Viewed 63 times
1 Answers
0
copy your assests files to the sdcard and when clicking on the button open the files in the sdcard as like this
File rootDir = Environment.getExternalStorageDirectory();
File file = new File(rootDir + "/filepath/"+fileName);//give the file path here
if(file.exists())
{
// do action here
}

Community
- 1
- 1

Ram kiran Pachigolla
- 20,897
- 15
- 57
- 78
-
I dont have the files in the assets folder now as I came to know they are not public, to place them on the SD-Card do I have to use the above method? Or there is a better way for this? – Heretic Monk Oct 01 '12 at 10:05
-
coping files from app to sd card is better. the above method works fine for your requirement. – Ram kiran Pachigolla Oct 01 '12 at 10:10