Put your database in your assets folder, then its path is given by "/data/data/<your-package-name>/databases/<dbname>"
Android database location in app directory
-
18-07-2023 - |
Question
I don't understand why database files are stored in the android emulator or phone in the data folder data/data//databases rather than being stored in the application that uses it.
Logically, the database file must also be stored in the android app, right ?
If yes, where should it be stored in the app directory ?
Solution 2
OTHER TIPS
your database will be saved under data/data/myApp/database
and not in any other folder but your application folder, since database consider as a private to your app, android make it hard for people with non-root access to see your database. you still can store it in any place you like just point to it from your app.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow