GVillani82
GVillani82

Reputation: 17429

What happens if an android app, which creates database, is then uninstalled?

I developed and install an android application which create a sqlite database. If I uninstall this app the database will be automatically dropped?

Upvotes: 0

Views: 863

Answers (3)

Sandip Armal Patil
Sandip Armal Patil

Reputation: 5905

YES....
After create Database it will be located at data/data/YourPackage/mydatabase.db.
when you install application on Emulator or Phone then it will be visible in File Explorer.
This mydatabase.db file will be deleted when you uninstall your application but if you reinstall this application then this database file again created and will be available in your private folder.

Edit

Suppose you want to store some value in Database(SQLite), For this you need to create one java class like MySQLiteHelper and then you can simply write your value in database.
If you uninstall you application then your value and database will be deleted but if you again reinstall your application then your database again created but previous value will be lost.

Upvotes: 1

StErMi
StErMi

Reputation: 5469

I think so, database will be dropped with all files in your app's private folder :)

Upvotes: 0

Korniltsev Anatoly
Korniltsev Anatoly

Reputation: 3686

The database is a file in private storage ( /data/data/{package.name}/databases/db.file ) when you uninstall an app the /data/data/{package.name}/ is deleted, either the user associated to the app is.

Upvotes: 2

Related Questions