Android Question DB SQLite doesnt modified

mrjaw

Active Member
Licensed User
Longtime User
Hi!
I have an app that uses a sqlite database to store information about sales. The problem is that when I install the app the db cant be updated the info doesnt stored. I read that the DB is localized into a directory that is just for reading.
How to store info into my DB ? Where I must put ?
 

klaus

Expert
Licensed User
Longtime User
Is your database in the projects Files directory which means in the code File.DirAssets ?
If yes, you must copy the database somewhere else, File.DirAssets is read only.
Either in File.DirInternal if the database is used only by your application or File.DirRootExternal.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
As already suggested in post #3, in File.DirInternal if the database is used only by your application or File.DirRootExternal.
Have a look at the beginning in the Activity_Create routine in the SQLiteLight2 example in my signature, it uses File.DirInternal.
Or read chapter 4 SQLite Database in the User's Guide.
 
  • Like
Reactions: eps
Upvote 0
Top