What happens to a Sqlite database when app is removed

前端 未结 5 1747
执念已碎
执念已碎 2020-12-15 07:11

I\'m new to Android programming and trying to wrap my head around this just to make myself clear about how things work.

When creating Sqlite databases in an Android

5条回答
  •  一个人的身影
    2020-12-15 07:40

    Normally, the database would be stored in

    /data/data/package.name.of.your.app/databases
    

    However it's not a good thing to rely on this. It's much better to find it using getDatabasePath on ContextWrapper, such as:

    File dbFile = getDatabasePath(db_name);
    

    And, yes, normally the whole directory /data/data/package.name.of.your.app would be deleted if you uninstall the app.

提交回复
热议问题