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

99封情书 提交于 2019-12-11 14:25:12

问题


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


回答1:


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.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/13067585/what-happens-if-an-android-app-which-creates-database-is-then-uninstalled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!