Copy from file from assets folder to my package location for both (sdcard, or internal memory)

153 views Asked by At

I want to copy a pdf file from assets folder of my project to the folder where my project is installed, whether my project is installed on sdcard or internal memory.

i saw a solutions says to copy it from assets folder by AssetManager to /data/data/packageName

but does

/data/data/

means on internal and sdcard?

1

There are 1 answers

2
Simas On BEST ANSWER

You should never hardcode pathes. Instead get your application's data folder like this:

activity.getFilesDir().getPath();