How to automatically add files to app folder?

132 Views Asked by At

I'm trying to add files(images) to the app folder when my app is installed and every time if there is any update, I'd like to add more files to the app folder. How can i achieve this?

Thanks a lot.

Regards, Dexter

2

There are 2 best solutions below

2
On

Whatever you put in the apk is what the user gets. If you add images, then submit the update to Google Play, your users will have those images when they update.

Although your images should be in res/drawable, not in the app folder.

0
On

I'm trying to add files(images) to the app folder when my app is installed

That is not possible, as nothing of your code will run when your app is installed. You are welcome to detect when your app is first run and then do something.

every time if there is any update, I'd like to add more files to the app folder

If your minSdkVersion is 12 or higher, you should be able to register for ACTION_MY_PACKAGE_REPLACED in the manifest and then do something upon receipt of the broadcast.