Pergunta

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 ?

Foi útil?

Solução 2

Put your database in your assets folder, then its path is given by "/data/data/<your-package-name>/databases/<dbname>"

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top