Jaume
Jaume

Reputation: 3780

android copy folders from assets to internal device app data folder

I created two folders inside assets ("images" and "files") both containing some files. I need to copy it when first launch to data/data/com.relatedPackage.myApp keeping same name and same file contents. I am an iOS programmer and that os does not allow to copy whole folders so, in android, which is the proper method to do it?

Possible to copy whole folder "images" (including its files) from assets to data/...? That would be great. If not, should I create first empty folders using same names at data/... and then copy files from assets to current? In this case would be necessary to list all files inside folders in order to copy to data/...? Thank you.

Upvotes: 0

Views: 962

Answers (2)

user1398668
user1398668

Reputation: 11

You can copy zip folder & then unzip the same

Upvotes: 1

Ollie C
Ollie C

Reputation: 28509

You need to first make sure the folders exist, and if not create them. After that you need to copy the files individually by enumerating what files need copying. I'm not aware of any way to do this in bulk.

Upvotes: 0

Related Questions