Possible Duplicate:
how we can remove a file from the assets folder at runtime in android?
Is it possible to create a file in assets folder when an application is run and delete the same file when the app is stopped.
For assets
, you have read file permission only.
So you cannot create/delete files in the assets
directory. Following are the restrictions applied to assets
directory.
Only Read Permission available for this directory.
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.
You can use this directory for placing files like database file, font file etc...
Don't fight with it. It is not a proper way of dealing with files using the assets
directory.
You can use SDcard as a suitable location for creating and deleting files
You can use standard method for placing files in SDcard through app,
Environment.getExternalStoragePublicDirectory("filetype");