Automatically create and delete a file in the data folder

Possible duplicate:
how can we delete a file from the resource folder at runtime in android?

Is it possible to create a file in the asset folder when the application starts and delete the same file when the application is stopped.

+4
source share
2 answers

For an asset, you only have permission to read files. Thus, you cannot create / delete files in the resource folder. The following are the restrictions that apply to the resource folder.

1) Only Read Permission available for this folder. 2) File size for placing inside the assets limit to 10 MB.If you want to place then the larger file should be placed as chunk. 3) You can use this folder, for placing files like database file, font file etc... 

Do not be afraid of it. This is not the right way to work with files that use the resource folder. You can use an SD card that is suitable for creating and deleting files.

You can use the standard method for placing files in the SDcard through the application,

  Environment.getExternalStoragePublicDirectory("filetype"); 
+8
source

Apk is read-only and will not change in the activation folder / folder, which is similar to what you might be looking for. Check question

+1
source

All Articles