0

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?

MBH
  • 16,271
  • 19
  • 99
  • 149

1 Answers1

1

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

activity.getFilesDir().getPath();
Simas
  • 43,548
  • 10
  • 88
  • 116
  • this is actually what i was asking, so ill copy the file from assets to activity.getFilesDir().getPath(); – MBH Jun 19 '15 at 13:52
  • @MBH this means on your application's folder. This can be either on the SD or the internal card. – Simas Jun 19 '15 at 13:54