0

I need to delete the database file.Here is my code to delete the file.

String strDBFilePath="/data/data/snow.AppStore/databases/"+strAppDBName;
File file = new   File(strDBFilePath);
file.delete();

But it i can't delete the DB file.How to delete DB ????

2 Answers 2

1

A couple of questions.

  1. You are the developer of the snow App, or is it just an app for which you want to remove the database? If it's the latter you can do a 'clear data' in the 'manage applications' menu in the Android settings.
  2. Presuming you are the developer, why do you want to remove the database? For development purposes? If so you can connect your (virtual) device and remove the database via a file explorer? See the section on the file explorer in this article
  3. Why do you want to do it programmatically? Will it be a recurring task? You can also try the deleteDatabase method defined on the Context class

Good luck!

Johan

Sign up to request clarification or add additional context in comments.

Comments

0

You can only delete your own database file. Also I do not believe dots in the folder names are allowed and you do not need to do that since it gets deleted automatically when the app is deleted. Whats your use case?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.