Java – Delete the database file from the Assets folder

Delete the database file from the Assets folder… here is a solution to the problem.

Delete the database file from the Assets folder

I want to delete the files in the Assets folder at runtime. I have a database file in the Assets folder that is copied to the data folder at runtime, but after installing my application, the size of the application becomes twice as large (Assets + Data folder)!

How do I delete the database file from the Assets folder to avoid this?

Solution

You cannot delete files that are delivered with your application while running.

Check out the discussion about it:

How to remove a file in assets at run time?

The entire content of your APK is read-only and cannot be modified

Related Problems and Solutions