MBH
MBH

Reputation: 16619

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

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?

Upvotes: 0

Views: 153

Answers (1)

Simas
Simas

Reputation: 44128

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

activity.getFilesDir().getPath();

Upvotes: 1

Related Questions